Has anyone found a way around the Gutenberg HTML block changing HTML code when saved?

I the following AMP code that I need to insert:

<amp-iframe sandbox='allow-scripts allow-same-origin' layout=responsive resizable noloading src='https://public.flourish.studio/visualisation/456626/embed?auto=1' width=400 height=300>
<amp-img layout=fixed height=64 width=64 src='https://public.flourish.studio/resources/bosh.svg' placeholder style='margin: auto'></amp-img>
<div overflow></div></amp-iframe><p>
<a href='https://public.flourish.studio/visualisation/456626/?utm_source=embed&utm_campaign=visualisation/456626'>
<amp-img layout=fixed height=16 width=105 src='https://public.flourish.studio/resources/made_with_flourish.svg' alt='Made with Flourish'></amp-img></a></p>

But when I save it changes the amp-iframe and amp-img tags to amp -iframe and amp -img and breaks the code.

  • 1
    Did you use the "Custom HTML" block? Because I used that and tried the exact same HTML code in your question, and I didn't see any issues. – Sally CJ Jul 2 '19 at 0:45
  • Yes I did, it looks like it saves correctly, then I go to test the code, come back to edit the document and the code is broken – Vince Pettit Jul 2 '19 at 9:38
  • I'm still not getting the issue. I tried these: 1) Edit the post and save it. 2) View the post. 3) Edit it. and the HTML code remained as-is. Perhaps it's a theme/plugin issue on your site? – Sally CJ Jul 3 '19 at 3:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.