Opened 6 years ago
Last modified 6 years ago
#52463 new defect (bug)
Inline SVG - foreignObject support
| Reported by: | edent | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Awaiting Review |
| Component: | Formatting | Version: | 5.6.1 |
| Severity: | normal | Keywords: | 2nd-opinion |
| Cc: | Focuses: |
Description
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.
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
There is a workaround:
<!--raw--><!--/raw-->comment tags (or the shortcode) in the Text editor.