Add HTML Anchors (ID Attribute) to Attributes in Block Parser #28757
Labels
[Feature] Parsing
Related to efforts to improving the parsing of a string of data and converting it into a different f
Needs Technical Feedback
Needs testing from a developer perspective.
[Type] Enhancement
A suggestion for improvement.
Currently WP_Block_Parser and parse_blocks lists block classes/block styles among a block's attributes (attr), but the id attribute (HTML Anchor) can only be retrieved by parsing the HTML in innerHTML or innerContent, even when it is set by the user in a separate field under the Advanced block settings.
Given that there are more enhancements under discussion for the HTML Anchor (see #26685 ), and it will be important to any TOC features, it seems like the anchor should be included in a blocks listed attributes during parsing for easier php & server-side retrieval.
The text was updated successfully, but these errors were encountered: