记事本++模板崩溃问题
我使用 Notepad++ 进行 Web 开发已有几个月了。随着我继续使用它,我对它的设置越来越满意。不过,有一件事确实困扰着我。使用 JQuery 模板时,并非脚本的所有内容都能被识别。程序将仅突出显示和折叠直到脚本标记中包含的第一个结束标记。
例如:
<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>
上面的代码将崩溃为:
<script id="itemTemplate" type="text/html">
<div class="rowSubTitle">${subTitle}</div>
</div>
</li>
</script>
这当然是不正确的。这个问题有解决办法或至少有解决方法吗?我刚刚更新到版本 5.9,这对我来说仍然是一个问题。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
三个选项(增加难度):
一是使用
Language -> XML
。副作用是配色方案发生变化(但可以通过设置修复)。其次,创建您自己的用户定义语言。
我创建了一个,但由于某种原因,语法突出显示不起作用: http://pastebin.com/BxRvbbQV
构建您自己的 词法分析器
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++ 期望 2 个脚本标记之间的行是 Javascript,而不是 html。实际上我以前从未在脚本中见过 type="text/html" 。这是正确的吗?
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?