Aptana Studio 3 - 使用 HTML 5 的数据角色标签时的警告

发布于 2024-12-11 07:45:06 字数 341 浏览 4 评论 0原文

我想使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

鸠书 2024-12-18 07:45:07

我执行了下面的操作并解决了问题。

在首选项>阿普塔纳工作室>验证> HTML Tidy 验证器 >属性>>专有属性-->忽略

I performed below and it resolved the problem.

In Preferences > Aptana Studio > Validation > HTML Tidy Validator > Attributes >> Proprietary attributes --> ignore

时间你老了 2024-12-18 07:45:07

它更像是一个缺失的功能而不是一个错误。

在首选项>阿普塔纳工作室>验证您可以定义与您想要忽略的错误/警告相匹配的正则表达式。

.*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.

浅忆 2024-12-18 07:45:07

这件事困扰了我好几个月。我尝试了上面的解决方案,但它们不起作用。对我有用的是关闭 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.

我一直都在从未离去 2024-12-18 07:45:07

似乎它不支持这一点,我浏览了维基百科和他们的文档。所以我们必须忍受这个,直到插件出现。

Seems to it doesnt support for this, I went through Wikipedia and their doc. So we have to bear this until plug-in comes.

乞讨 2024-12-18 07:45:07

回复晚了,但我在搜索解决相同问题时发现了这个线程,尝试了正则表达式解决方案,这对我来说不起作用,所以想出了这个解决方案,它至少比禁用 HTML Tidy Validator 没有那么激烈:

窗口>首选项>阿普塔纳工作室>验证> HTML Tidy Validator

  • 更改属性>从警告到忽略或信息的专有属性

除了 jQuery Mobile(例如 Angular)之外,还有其他几个框架普遍使用自定义属性,因此我认为这并不是一件坏事,因为我不知道有哪个浏览器会破坏自定义属性属性,它们只是被忽略。

当您更改 HTML Tidy Validator 时,我还建议删除对没有内容的元素的警告,因为人们通常通过 JavaScript 填充这些元素。您可以这样做:

  • 更改 Elements >将空元素从“警告”删除为“忽略”或“信息”。

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

  • Change Attributes > Proprietary Attributes from Warning to either Ignore or Info.

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:

  • Change Elements > Trim Empty Elements from Warning to either Ignore or Info.
┾廆蒐ゝ 2024-12-18 07:45:07

解决我的构建的“无法识别”问题的正确路径是: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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文