[wp-trac] [WordPress Trac] #33981: Default Captions Should Use max-width

WordPress Trac noreply at wordpress.org
Fri Aug 25 19:51:03 UTC 2017


#33981: Default Captions Should Use max-width
--------------------------------------------------+------------------------
 Reporter:  Howdy_McGee                           |       Owner:  joemcgill
     Type:  enhancement                           |      Status:  assigned
 Priority:  normal                                |   Milestone:  4.9
Component:  Media                                 |     Version:  4.3.1
 Severity:  normal                                |  Resolution:
 Keywords:  has-patch has-unit-tests 2nd-opinion  |     Focuses:  ui
--------------------------------------------------+------------------------
Changes (by joemcgill):

 * keywords:  has-patch commit => has-patch has-unit-tests 2nd-opinion


Comment:

 @desrosj – Looks like we need to update the unit tests for this too. The
 only test I can see that currently covers this style in the HTML is the
 curiously named `test_img_caption_shortcode_with_old_format()` in
 'tests/phpunit/tests/media.php'. It was passing because it uses a loose
 `preg_match_all()` where `max-width: 20` and `width: 20` would both match
 `/width: 20/`.

 [attachment:33981.2.patch] Updates that test, but I'm wondering if our
 coverage for `img_caption_shortcode()` is adequate.

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


More information about the wp-trac mailing list