DescriptionThe code
x-- > 3
is valid javascript.
HTML 4 says of the grammar for comments:
White space is not permitted between the markup declaration open
delimiter("<!") and the comment open delimiter ("--"), but is
permitted between the comment close delimiter ("--") and the
markup declaration close delimiter (">").
So the -- > in the javascript snippet above could end an HTML comment, thus
defeating embedded mode guarantees. This can be solved by rendering it as
(x--) > 3.
This has to be done for post-decrement ops as the left hand argument to the
following operators >, >=, >>, >>>, >>=, >>>=.
This may be a security issue if clients use embedding and browsers
implement escaping text spans using the same grammar as HTML4 comments.
HTML5 has a tighter syntax for comments, and so a strict HTML5 parser would
not lose embedding.
Patch Set 1 #
MessagesTotal messages: 3
|
|||||||||||||||||||||||||||||||||||||