Make WordPress Core

#56672 closed defect (bug) (worksforme)

6.1 Beta no longer allows SVG in custom block dynamic rendering

Reported by: robglidden's profile robglidden Owned by:
Milestone: 6.1 Priority: high
Severity: blocker Version: 6.1
Component: Editor Keywords:
Focuses: Cc:


Testing Instructions

Steps to Reproduce

  1. In WP 6.0, create a custom block with dynamic HTML rendering
  2. In the 'render_callback' php function, return an SVG as part of the returned content.
  3. The SVG renders on the front end as expected.
  4. Switch to WP 6.1 with the beta tester plugin.
  5. 🐞 The SVG disappears on the front end. It is stripped from the HTML>

I imagine that there is some new escaping on the HTML returned from the 'render_callback' function.

However, there needs to be some way to insert an SVG in a dynamic PHP-rendered custom block.

I also notice the same stripping of SVG occurs when I use the new block.json render feature ("render": "file:./render.php").

Change History (3)

#1 @audrasjb
19 months ago

  • Component changed from General to Editor
  • Milestone changed from Awaiting Review to 6.1
  • Priority changed from normal to high

This ticket was mentioned in Slack in #core by audrasjb. View the logs.

19 months ago

#3 @robglidden
19 months ago

  • Resolution set to worksforme
  • Status changed from new to closed

For whatever reason, this is now working properly in 6.1 Beta 2

Note: See TracTickets for help on using tickets.