Open sfermigier opened 1 year ago
Normally, following HTML code is not correct:
curlylint right now fails (I think this is the expected behaviour):
If your pull request is applied, will the HTML code above pass the check?
I believe whitespace before >
is correct. xmllint
confirms.
~/tmp> cat toto.xml
<toto
>
</toto
>
~/tmp> xmllint toto.xml
<?xml version="1.0"?>
<toto>
</toto>
# Or
~/tmp> cat toto.xml
<toto >
</toto >
~/tmp> xmllint toto.xml
<?xml version="1.0"?>
<toto>
</toto>
See also the XML grammar:
https://www.w3.org/TR/xml/#NT-ETag
(S?
stands for "whitespace" in the production rule).
That makes sense!
make_opening_tag_parser function already skips whitespaces:
return locate(
P.seq(
P.string("<"),
tag_name_parser,
attributes.skip(whitespace),
slash,
P.string(">"),
)
).combine(_combine_opening_tag)
And the make_closing_tag_parser
function should skip whitespaces too!
@thibaudcolas Can you review the pr
Don't throw up on correct HTML.