[wp-trac] [WordPress Trac] #24085: wpautop filter and shortcodes

WordPress Trac noreply at wordpress.org
Mon Oct 7 22:12:45 UTC 2013


#24085: wpautop filter and shortcodes
--------------------------+-----------------------------
 Reporter:  Looimaster    |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Future Release
Component:  Shortcodes    |     Version:  3.6
 Severity:  normal        |  Resolution:
 Keywords:                |
--------------------------+-----------------------------

Comment (by lkraav):

 Replying to [comment:11 lkraav]:
 >
 > I've just discovered that it's hugely important for the
 [http://core.trac.wordpress.org/browser/tags/3.6.1/wp-
 includes/formatting.php#L233 wpautop() $pees array] to have double line
 breaks to properly separate shortcodes from content. Visual editor adds
 double line break automatically, but in Text mode you need to do it
 manually.

 Either way, {{{shortcode_unautop}}} is still indeed borken:

 This is what comes in:
 {{{
 [07-Oct-2013 22:08:57] Array
 (
     [0] => shortcode_unautop
     [1] => <p>[TBS_ROW fluid="y"]</p>
 <p>[TBS_SPAN size="6"]</p>
 <p>The 6oth day.</p>
 <p>[/TBS_SPAN]</p>
 <p>[TBS_SPAN size="6"]</p>
 <p>Your abs will be tighter, your arms will be leaner and your butt will
 be higher. You won’t be able to stop admiring yourself in the mirror or
 wipe the smile off your face.</p>
 <p>[/TBS_SPAN]</p>
 <p>[/TBS_ROW]</p>
 )
 }}}

 And this is what we get:
 {{{
 [07-Oct-2013 22:08:57] Array
 (
     [0] => shortcode_unautop return
     [1] => [TBS_ROW fluid="y"]</p>
 <p>[TBS_SPAN size="6"]</p>
 <p>The 6oth day.</p>
 <p>[/TBS_SPAN]</p>
 <p>[TBS_SPAN size="6"]</p>
 <p>Your abs will be tighter, your arms will be leaner and your butt will
 be higher. You won’t be able to stop admiring yourself in the mirror or
 wipe the smile off your face.</p>
 <p>[/TBS_SPAN]</p>
 <p>[/TBS_ROW]
 )
 }}}

 Big yey for unbalanced <p> tags! Is the function really supposed to remove
 just the first instance of <p></p>?

--
Ticket URL: <http://core.trac.wordpress.org/ticket/24085#comment:12>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list