[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:56:41 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 1000camels):

 Replying to [comment:27 peterwilsoncc]:
 > 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.

 Oh boy. Now I am not sure how to deal with commas and spaces in URLs. The
 width descriptor is optional, there may or may not be a space within each
 image candidate.

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


More information about the wp-trac mailing list