[wp-trac] [WordPress Trac] #52463: Inline SVG - foreignObject support
WordPress Trac
noreply at wordpress.org
Sun Feb 7 11:06:11 UTC 2021
#52463: Inline SVG - foreignObject support
--------------------------+-----------------------------
Reporter: edent | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version: 5.6.1
Severity: normal | Keywords:
Focuses: |
--------------------------+-----------------------------
WordPress 5.6.1 mangles SVGs which use the [Foreign Object
element](https://developer.mozilla.org/en-
US/docs/Web/SVG/Element/foreignObject).
Consider this minimum viable example:
{{{
<svg xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink">
<foreignObject>
<blockquote xmlns="http://www.w3.org/1999/xhtml">
Hello
</blockquote>
</foreignObject>
</svg>
}}}
WordPress adds in some `</p>` which malforms the image:
{{{
<p>
<svg xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink">
<foreignObject></p>
<blockquote xmlns="http://www.w3.org/1999/xhtml"><p>
Hello
</p></blockquote>
<p></foreignObject>
</svg></p>
}}}
This occurs when pasting the raw SVG into the classic editor.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/52463>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list