Block validation: exclude data attributes / add support for custom validators #8532
Labels
[Feature] Paste
[Status] Duplicate
Used to indicate that a current issue matches an existing one and can be closed
Dear Gutenberg Team,
i'm currently developing a Gutenberg Plugin to integrate EnlighterJS Syntax Highlighter into to editor and ran into serious trouble regarding the "block/element validation":
Because of the strict 1:1 structure validation there seems to be no possibility? to add optional attributes to the elements generated by the
save
function.The editor always throws element validation errors in case custom attributes are added (e.g. manually by a user - which might be legitimate).
Of course, its possible to add all allowed attributes to the output...but this will mess-up the generated html with a lot of unused attributes
Example HTML Structure
Typical Validation Error
Suggestions
data-
attributes from validation (they represent an elements state, not its structure)registerBlockType
) to allow users to override the default behaviouroptional
flagbest regards, Andi
The text was updated successfully, but these errors were encountered: