admin管理员组文章数量:1332352
If I edit a block html and add a data-* attribute to the element, the editor complains and says that "This block contains unexpected or invalid content.".
for example, the perfectly valid html:
<h2 data-foo="bar">...</h2>
is marked as invalid by the editor. Bug, or am I doing something wrong? Other attributes, such as id can be added to headings, but not to, for example paragraphs.
My use case is that I have a filter function that acts on content_save_pre and adds both id and a data-attribute to specific headings. As long as the html is valid, I don't understand why the Gutenberg editor would complain.
本文标签: htmldata* attributes in blocks
版权声明:本文标题:html - data-* attributes in blocks 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742322060a2452985.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论