You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Glad you asked this question, as it might be a tricky one 😄
It happens that pre tag is not a special tag after all. Its just a regular tag (except for the new lines; afair). Which means, inner HTML has to be encoded, too! Thats why you see the error/warning.
There will be errors regarding the Bar word - that is interpreted as a tag. Once when you encode the < and >, the validation goes fine.
parseSpecialTagsAsCdata field only affects: style, script and xmp tags (see documentation). And it is set to true by default in HTML5 mode (which is also default); in other modes (XHTML/XML) it is not set as user needs to encode the content of these tags, too.
Oh sorry, you're absolutely right!
The sample I was testing was the home page of a famous framework and I realize that the <Bar> doesn't show up in a browser either.
Hi,
I have some html code that contains code blocks within
<pre>
tags, such as:Lagarto complains that the
<bar>
tag is not properly closed, even when settingparseSpecialTagsAsCdata
to true.IMHO,
parseSpecialTagsAsCdata
should handle this tag.Moreover, shouldn't
parseSpecialTagsAsCdata
default to true?Thanks a lot for this great library, it rocks!
Regards,
Stéphane
The text was updated successfully, but these errors were encountered: