[wp-trac] [WordPress Trac] #29807: add support for picture element and srcset attribute on img in wp_kses

WordPress Trac noreply at wordpress.org
Thu Oct 4 06:07:03 UTC 2018


#29807: add support for picture element and srcset attribute on img in wp_kses
-------------------------------------------------+-------------------------
 Reporter:  mattheu                              |       Owner:  (none)
     Type:  enhancement                          |      Status:  new
 Priority:  normal                               |   Milestone:  Future
                                                 |  Release
Component:  Formatting                           |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch has-unit-tests needs-      |     Focuses:
  refresh                                        |
-------------------------------------------------+-------------------------

Comment (by peterwilsoncc):

 Replying to [comment:26 1000camels]:
 > I am enthusiastic, but might not be skilled enough.

 Thanks for your enthusiasm and I am sure you have the skill set required.

 I like the idea of adapting the current URL validation but I think WP will
 need to use a special case function similar to that for the `style`
 attribute.

 While commas should technically be encoded as `%2C` in URL attributes,
 most browsers parse them successfully when unencoded, as seen in
 [https://jsbin.com/nokucuq/edit?html,output this example on jsbin]. There
 are a number of popular services that advise using commas unencoded, such
 as Google Fonts, that WP needs to allow for too.

 Code wise, I like your approach of splitting up the URL candidates (as a
 special case for srcset) but you will need to split each item in
 `$thesevals` on whitespace before passing the data through to protocol
 validation.

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


More information about the wp-trac mailing list