Changes between Initial Version and Version 4 of Ticket #51417
- Timestamp:
- 11/05/2020 10:31:39 AM (4 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #51417
- Property Keywords needs-patch added
-
Property
Milestone
changed from
Awaiting Review
toFuture Release
-
Ticket #51417 – Description
initial v4 1 1 Hi, 2 2 We have new, way more efficient graphic formats coming - avif and webp. They are already supported by Firefox and Chrome. The recommended and backwards compatible method of inserting them is using a picture tag with an img fallback, for example: 3 4 5 6 7 8 9 3 {{{ 4 <picture> 5 <source srcset="example.avif" type="image/avif"> 6 <source srcset="fallback.webp" type="image/webp"> 7 <img src="fallback.jpg" alt="AVIF example with WebP and JPEG fallback"> 8 </picture> 9 }}} 10 10 Using the filter tiny_mce_before_init I can make TinyMCE accept the code if it is not surrounded by caption shortcode. Unfortunately the editor handles the [caption] code in javascript, the file is wp-includes/js/tinymce/plugins/wpeditimage/plugin.js 11 11 and it has a filter: 12 13 14 12 {{{ 13 img = c.match( /((?:<a [^>]+>)?<img [^>]+>(?:<\/a>)?)([\s\S]*)/i ); 14 }}} 15 15 which removes everything except a and img tags. So <picture> and <source> become stripped. There is no filter nor configuration to modify how that JS works. 16 16