hygraph / rich-text

A set of companion packages for Hygraph's Rich Text Field
MIT License
93 stars 18 forks source link

`<iframe>` tags are broken in the AST transform #126

Closed mikehdt closed 5 months ago

mikehdt commented 5 months ago

The code here...

https://github.com/hygraph/rich-text/blob/617ec60c9410ac60dc54c043de0e15216924b850/packages/html-renderer/src/elements/IFrame.tsx#L14-L29

will result in a broken HTML page, if an <iframe> element is present. <iframe> tags are not allowed to be self-closing. See https://stackoverflow.com/questions/27545757/why-is-a-self-closing-iframe-tag-preventing-further-dom-elements-to-be-displayed for example.

Instead, <iframe> tags must have a corresponding full closing </iframe> tag. Some browsers may try to correct for this, but that functionality should not be relied on.

jpedroschmitz commented 5 months ago

Thanks for the report, @mikehdt!

We released 0.3.1, which fixes the issue!

Have a great week! 🙌🏻