• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Not a bug Nested <xen:comment> throws an error

Mike

XenForo developer
Staff member
#2
By definition, you can't wrap a comment in a comment. The same is happens in HTML, but the better parallel is actually <script> or <style> tags. This actually applies to plain BB code tags as well. And block comments in various programming languages.

Inside a comment (or script/style tags), you change the parsing rules: everything is a plain comment until it ends. If you didn't do this, you wouldn't be able to comment out invalid code. As such, when you "open" another comment, it's just a bit of text. As soon as you close the comment, it's back to the regular rules and since it closed before you expected, you now have invalid output.