1. 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

Discussion in 'Resolved Bug Reports' started by rellect, Jul 18, 2014.

  1. rellect

    rellect Well-Known Member

    Per title.
    I have comments for some sections in my code, tried to wrap in comment the whole thing and got an error.
  2. Mike

    Mike XenForo Developer Staff Member

    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.
    Liam W and rellect like this.

Share This Page