CDATA is not properly rendered in html files



  • <script>
    var x= ‘<Content><![CDATA[This is a first paragraph!<DIV>&nbsp;</DIV>And this is a second paragraph.]]></Content>’;
    </script>

    is not properly rendered in NotePad++ using html-styling.
    Why is that? Can I do something? Is there another html-plugin that will work correctly?

    One should expect one of the following:

    1. from opening apostrophe to closing apostrophe rendered as a string (grey by default)
    2. the phrase ‘<Content> rendered as a string and <![CDATA[ to ]]> rendered as CDATA (orange by default) and the phrase </Content>’ rendered as string.

    But now the CDATA section stops at &nbsp;. Starting from </DIV> the parser sees the remaing content as html i.e. it is rendered in blue and bold black.

    This creates lots of confusing while editing the html document.



  • Hello @Carl-in-'t-Veld,

    AFAIK this how the current lexer is working.
    Don’t know of any other html lexer yet.

    Cheers
    Claudia


Log in to reply