[wp-trac] [WordPress Trac] #28564: Shortcode Attributes with HTML Tags no longer working

WordPress Trac noreply at wordpress.org
Sun Jun 22 01:26:03 UTC 2014


#28564: Shortcode Attributes with HTML Tags no longer working
------------------------------------------+-----------------------------
 Reporter:  baden03                       |       Owner:  wonderboymusic
     Type:  defect (bug)                  |      Status:  reopened
 Priority:  high                          |   Milestone:  4.0
Component:  Formatting                    |     Version:  trunk
 Severity:  major                         |  Resolution:
 Keywords:  has-patch commit wptexturize  |     Focuses:
------------------------------------------+-----------------------------

Comment (by kitchin):

 The test case in Sergey Biryukov's comment:1 still fails.
 > Broken in [28727].
 >
 > To reproduce:
 > 1. Register a shortcode:
 > {{{
 > function footag_func( $atts ) {
 >      return "title = {$atts['title']}";
 > }
 > add_shortcode( 'expand', 'footag_func' );
 > }}}
 > 2. Create a post with this content: `[expand title="<strong>Strong
 Test</strong>"][/expand]`.
 >
 > Output:
 > * Before [28727]: `title = <strong>Strong Test</strong>`.
 > * After [28727]: `title = »<strong>Strong`.

 My updated results.
 Output:
 * Wordpress 3.9.1: `title = <strong>Strong Test</strong>`.
 * Trunk after [28773]: `title = <strong>Strong Test</strong>`.

 I would also like to consider "well-formed HTML," mentioned in comment:11
 and comment:13. The author of the popular jQuery slide show plugin Cycle
 has released a substantially different plugin called Cycle2. It moves most
 of the parameters from JS to HTML data attributes. This has brought grief
 to simple HTML parsers because it encourages the following type of HTML,
 as seen in the Cycle2 manual, http://jquery.malsup.com/cycle2/demo/non-
 image.php :

 `<div class="cycle-slideshow" data-cycle-slides="> div">`

 While I deplore it personally, everyone seems to agree it is proper HTML.
 (The data is indicating the CSS selector for a slide show.) I know of
 plugins at wordpress.org/extend using Cycle2, and at least one that could
 probably be coerced into executing a shortcode with that type of HTML.
 Anyway it's a change in behavior and could use a Unit test for whatever
 the expected result is, like comment:1.

 Here's my test for Cycle2 inspired HTML:

 ...
 2. Create a post with this content: `[expand title="div >
 blockquote"][/expand]`.
 Output:
 * Wordpress 3.9.1: `title = div > blockquote`.
 * Trunk after [28773]: `title = ”div`.

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


More information about the wp-trac mailing list