Allow custom HTML attributes to gutenberg elements
-
I can’t understand why wordpress gutenberg editor is not allowing me to add custom html attributes, Although It works just fine on the frontent but in the editor it throws an error saying
"This block contains unexpected or invalid content."
I have column block and I want to add some microdata to the div eg: itemscope=”” itemprop=”mainEntity” itemtype=”https://schema.org/Question”.
<!-- wp:columns --> <div class="wp-block-columns"><!-- wp:column --> <div class="wp-block-column"><!-- wp:group {"layout":{"type":"flex","flexWrap":"nowrap","orientation":"vertical"}} --> <div class="wp-block-group"><!-- wp:heading --> <h2>Question</h2> <!-- /wp:heading --> <!-- wp:group {"layout":{"type":"flex","flexWrap":"nowrap"}} --> <div class="wp-block-group" itemscope="" itemprop="mainEntity" itemtype="https://schema.org/Question"> <!-- wp:paragraph --> <p>Answer</p> <!-- /wp:paragraph --> </div> <!-- /wp:group --></div> <!-- /wp:group --></div> <!-- /wp:column --></div> <!-- /wp:columns -->
Please help to get rid of the attempt recovery message from the editor.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Allow custom HTML attributes to gutenberg elements’ is closed to new replies.