简体   繁体   English

WebStorm HTML格式错误-预期换行或分号

[英]WebStorm HTML formatting error - Expecting newline or semicolon

I am editing an HTML page in WebStorm. 我正在WebStorm中编辑HTML页面。 For some reason it's treating regular text like a JavaScript statement and throwing errors on code check 'Expecting newline or semicolon'. 由于某种原因,它会将常规文本视为JavaScript语句,并在代码检查“期望换行符或分号”上引发错误。 If the text is within an anchor tag it does not give an error. 如果文本在锚标记内,则不会出现错误。

Is this a bug? 这是错误吗? My JavaScript version is set to ES6. 我的JavaScript版本设置为ES6。

HTML text showing an error: HTML文字显示错误:

在此处输入图片说明

WebStorm code check error: WebStorm代码检查错误:

在此处输入图片说明

  1. Go to Settings/Preferences | Editor | Language Injections 转到Settings/Preferences | Editor | Language Injections Settings/Preferences | Editor | Language Injections
  2. Please remove 3rd rule from the bottom (the one that has "IDE" in Scope column) 请从底部删除第三个规则(“作用域”列中带有“ IDE”的规则)

You somehow (accidentally) created such wrong injection rule and now every <li> tag is treated as AngularJS hence the warnings. 您以某种方式(偶然)创建了错误的注入规则,现在每个<li>标记都被视为AngularJS,因此出现了警告。

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

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