Custom Gutenberg Block: How to return plain HTML with save(), without escaping?
I'm writing a custom Gutenberg editor block.
When saving the block I can save simple HTML elements, like in the documentation:
return wp.element.createElement('div', blockProps, 'Your block.');
However, I need to return some huge and complicated HTML that I cannot produce in that way. To give you an impression:
div class=wrappersvg class=some-svg-image version=1.1 xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink x=0px y=0px viewBox=0 0 600 600 xml:space=preserve aria-labelledby=catTitle catDesc role=img...g...path.../svg/div
When I return this as a string, it will be escaped.
How can I prevent escaping for the HTML that I return with the save()
method?
Topic block-editor Wordpress
Category Web