[wp-trac] [WordPress Trac] #51417: TinyMCE stripping <picture> tags

WordPress Trac noreply at wordpress.org
Wed Sep 30 13:22:41 UTC 2020


#51417: TinyMCE stripping <picture>  tags
-------------------------------+-----------------------------
 Reporter:  Grzegorz.Janoszka  |       Owner:  (none)
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Future Release
Component:  TinyMCE            |     Version:  5.5.1
 Severity:  normal             |  Resolution:
 Keywords:  needs-patch        |     Focuses:
-------------------------------+-----------------------------
Changes (by azaozz):

 * keywords:   => needs-patch
 * milestone:  Awaiting Review => Future Release


Comment:

 > I am not asking for a full <picture> support in WordPress.

 Why not? It would be great to add imho :)

 I've looked at what would it take to add full `<picture>` support to
 WordPress. The above is just one place that needs fixing, another is in
 `wpautop()`, and another is the block editor's image, gallery, media and
 text, etc. blocks. Then there is the question of adding "responsive images
 support" similar to `srcset` and `sizes` attributes in img tags. Of
 course, each of these would need a separate ticket.

 Seems that adding support for `<picture>` to the rendering of `[caption]`
 shortcode in the classic editor will only need changes to the regex here:
 https://core.trac.wordpress.org/browser/tags/5.5.1/src/js/_enqueues/vendor/tinymce/plugins/wpeditimage/plugin.js#L118.
 Note that the [caption] shortcode is rendered differently in the classic
 editor and on the front-end. The difference is only in the "wrapper"
 element(s), so perhaps replacing `<img>` with `<picture>` would not
 introduce back-compat problems.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/51417#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list