简体   繁体   English

如何修复脚本标记中使用的注释语法?

[英]How do I fix the comment syntax used inside script tags?

While editing an HTML file in IntelliJ IDEA, when I use Command-/ to comment a line of JavaScript inside a script tag, the comment that is created has a curly brace & hash instead of a slash and asterisk: 在IntelliJ IDEA中编辑HTML文件时,当我使用Command- /在脚本标记内注释一行JavaScript时,创建的注释带有花括号和哈希,而不是斜杠和星号:

<script>
{# this is a comment #} 
</script>

Instead of: 代替:

<script>
// this is a comment 
</script>

How can I determine why IntelliJ is using this comment format and how can I fix it? 我如何确定IntelliJ为什么使用此注释格式以及如何解决它?

Thanks! 谢谢!

It turns out I had Jinja2 selected as a Python template language in Preferences > Languages & Frameworks > Python Template Languages. 事实证明,我在“偏好设置”>“语言和框架”>“ Python模板语言”中选择了Jinja2作为Python模板语言。 I changed the template language there to None and now Command-/ seems to be working normally again. 我将模板语言更改为“无”,现在Command- /似乎又能正常工作了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM