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.
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
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?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With