Aptana Studio 3 - 使用 HTML 5 的数据角色标签时的警告
我想使用 Aptana Studio 3 开发 jquery-mobile 项目。由于 jquery-mobile 使用 HTML5,我必须使用像 "data-role="header"
这样的标签属性,这对于 HTML5 来说是可以的。
例如:
<div data-role="header"></div>
但是 Aptana 给了我这样的警告:
未知属性“数据角色”
我该如何解决这个问题,或者它是 Aptana Studio 3 的错误?
I want to use Aptana Studio 3 for developing jquery-mobile projects. Since jquery-mobile uses HTML5 I have to use tag attributes like "data-role="header"
which is OK for HTML5.
For example:
<div data-role="header"></div>
But Aptana gives me warnings like:
unknown attribute "data-role"
How can I fix this, or is it an Aptana Studio 3 bug?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
我执行了下面的操作并解决了问题。
在首选项>阿普塔纳工作室>验证> HTML Tidy 验证器 >属性>>专有属性-->忽略
I performed below and it resolved the problem.
In Preferences > Aptana Studio > Validation > HTML Tidy Validator > Attributes >> Proprietary attributes --> ignore
它更像是一个缺失的功能而不是一个错误。
在首选项>阿普塔纳工作室>验证您可以定义与您想要忽略的错误/警告相匹配的正则表达式。
.*data-role.*
应该可以。It more of a missing feature than a bug.
In Preferences > Aptana Studio > Validation you can define regular expression that match to errors/warnings you want to be ignored.
.*data-role.*
should do it.这件事困扰了我好几个月。我尝试了上面的解决方案,但它们不起作用。对我有用的是关闭 Aptana 3.2.2 中的 HTML Tidy Validator。
首选项 ->阿普塔纳工作室 ->验证-> HTML
然后关闭 HTML Tidy Validator 进行构建和协调。
This had bugged me for months. I tried the solutions above but they didn't work. What did work for me was turning off HTML Tidy Validator in Aptana 3.2.2.
Preferences -> Aptana Studio -> Validation -> HTML
And then turn off HTML Tidy Validator for build and reconciliation.
似乎它不支持这一点,我浏览了维基百科和他们的文档。所以我们必须忍受这个,直到插件出现。
Seems to it doesnt support for this, I went through Wikipedia and their doc. So we have to bear this until plug-in comes.
回复晚了,但我在搜索解决相同问题时发现了这个线程,尝试了正则表达式解决方案,这对我来说不起作用,所以想出了这个解决方案,它至少比禁用 HTML Tidy Validator 没有那么激烈:
窗口>首选项>阿普塔纳工作室>验证> HTML Tidy Validator
除了 jQuery Mobile(例如 Angular)之外,还有其他几个框架普遍使用自定义属性,因此我认为这并不是一件坏事,因为我不知道有哪个浏览器会破坏自定义属性属性,它们只是被忽略。
当您更改 HTML Tidy Validator 时,我还建议删除对没有内容的元素的警告,因为人们通常通过 JavaScript 填充这些元素。您可以这样做:
Late response but I found this thread while searching to resolve the same issue, tried the regex solution, which didn't work for me, so came up with this solution, which is at least less drastic than disabling HTML Tidy Validator:
Window > Preferences > Aptana Studio > Validation > HTML Tidy Validator
There are several other frameworks other than jQuery Mobile (Angular for example) where the use of custom attributes is common, so I don't think this is a bad thing to do, as I don't know of any browser that breaks with custom attributes, they just get ignored.
While you're changing HTML Tidy Validator, I'd also recommend removing the warning for elements with no content as often folks populate those through JavaScript. You can do so like this:
解决我的构建的“无法识别”问题的正确路径是:Window > >首选项>阿普塔纳工作室>验证> HTML Tidy 验证器 >元素>无法识别的元素>忽略
The correct path to resolve the "unrecognized" issue for my build is: Window > Preferences > Aptana Studio > Validation > HTML Tidy Validator > Elements > Unrecognized elements > Ignore