Treat <textarea> as whitespace-sensitive

This commit is contained in:
Wilson Lin 2021-05-23 11:54:30 +10:00
parent 080d4e0c96
commit 85b1c6658c
2 changed files with 2 additions and 1 deletions

View File

@ -71,7 +71,6 @@ lazy_static! {
m.insert(b"option", CONTENT);
m.insert(b"p", CONTENT);
m.insert(b"summary", CONTENT);
m.insert(b"textarea", CONTENT);
m.insert(b"video", CONTENT);
// Content-first tags.
@ -158,6 +157,7 @@ lazy_static! {
m.insert(b"ul", LAYOUT);
// Whitespace-sensitive tags.
m.insert(b"textarea", WHITESPACE_SENSITIVE);
m.insert(b"code", WHITESPACE_SENSITIVE);
m.insert(b"pre", WHITESPACE_SENSITIVE);

View File

@ -88,6 +88,7 @@ fn test_collapse_destroy_whole_and_trim_whitespace() {
#[test]
fn test_no_whitespace_minification() {
eval(b"<pre> \n&#32; \t </pre>", b"<pre> \n \t </pre>");
eval(b"<textarea> \n&#32; \t </textarea>", b"<textarea> \n \t </textarea>");
// Tag names should be case insensitive.
eval(b"<pRe> \n&#32; \t </PRE>", b"<pre> \n \t </pre>");
eval(b"<pre> <span> 1 2 </span> </pre>", b"<pre> <span> 1 2 </span> </pre>");