Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow ID attribute (HTML Anchor) on all blocks #21023

Closed
bobeaston opened this issue Mar 19, 2020 · 1 comment
Closed

Allow ID attribute (HTML Anchor) on all blocks #21023

bobeaston opened this issue Mar 19, 2020 · 1 comment
Labels
[Type] Enhancement A suggestion for improvement.

Comments

@bobeaston
Copy link

Essentialy, this is a request for reconsideration of issue #8124.

Currently (as of 5.4-RC3-47470) attempts to use id="foo" on any block type other than Heading or Group is either removed while converting to blocks or is flagged as invalid HTML when editing blocks. The attribute is useful for many other block types and is compliant HTML according to the latest W3C HTML specification, which says: "The class, id, and slot attributes may be specified on all HTML elements."

If we respect the W3C specification, all block types should support the HTML anchor attribute. The decision made in #8124 to "allow the id attribute on blocks that support anchor" conflicts with the W3C specification. WordPress should not be treating the attribute as invalid when converting from Classic to blocks.

Now, for the UI side of the question: From a practical point of view, most people will rarely need a UI element, like the one under Advanced in the current Heading block, in the editor to add an HTML Anchor. So, it might not be useful to provide the UI for some block types. From 20+ years of experience, I think it would be useful to have the UI element on these block types: Heading, Paragraph, Separator, Form, Table, Group ... and maybe Collections.

@talldan talldan added the [Type] Enhancement A suggestion for improvement. label Apr 7, 2020
@paaljoachim
Copy link
Contributor

This feature has been added to Gutenberg.
I will go ahead and close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

3 participants