An alternative to HTML::Tagset

HTML::Tagset
is a popular module on CPAN and has nearly nine thousand descendants in the “River of CPAN”. Unfortunately its last version was in March 2008, nearly ten years ago, so it doesn’t feature the HTML5 tags yet. There has been some discussion on the HTML tag set bug tracker
but so far that has not come to fruition. As an alternative to HTML::Tagset, I made the module HTML::Valid::Tagset
, which incorporates the data tables of the “Tidy HTML5” project
.

It’s partly based on HTML::Tagset’s interface, so it can substitute for some of that module’s functionality, and it also has specific tag sets for each version of HTML, including HTML5.

Having the Tidy HTML5 data tables means I was also able to add a function
attributes

which returns a list of valid attributes for a tag, and
tag_attr_ok

, which returns true or false depending on whether a particular tag can take a particular attribute. This is part of a larger distribution called HTML::Valid, based on the Tidy HTML5 project.

blogs.perl.org责编内容来自:blogs.perl.org (源链) | 更多关于

阅读提示:酷辣虫无法对本内容的真实性提供任何保证,请自行验证并承担相关的风险与后果!
本站遵循[CC BY-NC-SA 4.0]。如您有版权、意见投诉等问题,请通过eMail联系我们处理。
酷辣虫 » 前端开发 » An alternative to HTML::Tagset

喜欢 (0)or分享给?

专业 x 专注 x 聚合 x 分享 CC BY-NC-SA 4.0

使用声明 | 英豪名录