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

WordPress Trac noreply at wordpress.org
Fri Oct 5 01:46:42 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):

 Ok, I can work on this. But I am wondering about applying this logic to
 another function, so that we aren't looping on this condition three times.
 Plus, I think this should also be applied to wp_kses_one_attr(), which
 wasn't accounting for the addition of srcset and sizes. Hopefully this is
 a better approach.

 I've also added a test for a url that has commas but no space. In order to
 pass this test, I have adjusted the regex to /\s*,\s+/.
 This is assuming that the following space is always there, which does not
 quite match the [https://w3c.github.io/html/semantics-embedded-
 content.html#element-attrdef-img-srcset the srcset spec]. Is there another
 character (ie. :) that would definitely identify a url portion of the
 string?

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


More information about the wp-trac mailing list