Talk:Preprocessor ABNF
Latest comment: 16 years ago by Tim Starling in topic nested HTML comments
nested HTML comments
editHere is how the current parser handles nested HTML comments:
code | becomes | expected | per SGML | per XML |
---|---|---|---|---|
<<!---->!---->
|
<!----> | <!----> | <!----> | |
<!<!---->---->
|
<!----> | <!----> | <!----> | |
<!-<!---->--->
|
<!----> | <!----> | <!----> | |
<!--<!---->-->
|
--> | --> | invalid | |
<!---<!---->->
|
-> | -> | unterminated comment | invalid |
<!----<!---->>
|
> | > | invalid | invalid |
As of today, the three upper strings where the opening comment token is broken become blank. --Yecril71pl 16:08, 11 September 2008 (UTC)
- This is expected. Preprocessing according to this spec converts <<!---->!----> to <!---->. You can check this using Special:ExpandTemplates. Then, following preprocessing, Sanitizer::removeHTMLtags() removes the comments, producing blank output. The behaviour of Sanitizer::removeHTMLtags() is not included in this spec. -- Tim Starling 07:49, 12 September 2008 (UTC)