Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Notepad++ Template Collapse Issue

I have been working with Notepad++ for web development for a few months now. As I continue to work with it, I am more and more pleased with its setup. One thing really bothers me, though. When working with a JQuery template, not all of the contents of the script are recognized. The program will highlight and collapse only up until the first closing tag contained within the script tag.

For example:

<script id="itemTemplate" type="text/html">
    <li class="row">
        <div class="rowTextContainer">
            <div class="rowTitle">${title}</div>
            <div class="rowSubTitle">${subTitle}</div>
        </div>
    </li>
</script>

The above code would collapse down to:

<script id="itemTemplate" type="text/html">
    <div class="rowSubTitle">${subTitle}</div>
        </div>
    </li>
</script>

Which is certainly not correct. Is there a fix or at least a workaround for this issue? I've just updated to version 5.9 and this is still a problem for me.

like image 287
BCDeWitt Avatar asked May 17 '11 17:05

BCDeWitt


2 Answers

Three options (increasing level of difficulty):

One is to use Language -> XML. The side effect is that the color scheme changes (but that can be fixed with settings).

Second, create your own user defined language. I created one but for some reason, syntax highlighting is not working: http://pastebin.com/BxRvbbQV

Build your own lexer

like image 151
Mrchief Avatar answered Sep 19 '22 04:09

Mrchief


Notepad++ is expecting the lines between the 2 script tags to be Javascript, not html. I've actually never seen type="text/html" in a script before. Is this correct?

like image 35
whoabackoff Avatar answered Sep 20 '22 04:09

whoabackoff