[wp-trac] Re: [WordPress Trac] #6969: Don't apply wptexturize() to
the insides of shortcode tags
WordPress Trac
wp-trac at lists.automattic.com
Mon May 4 16:13:07 GMT 2009
#6969: Don't apply wptexturize() to the insides of shortcode tags
--------------------------+-------------------------------------------------
Reporter: Viper007Bond | Owner: tellyworth
Type: enhancement | Status: new
Priority: normal | Milestone: Future Release
Component: Formatting | Version: 2.5.1
Severity: normal | Keywords: needs-patch 2nd-opinion dev-feedback
--------------------------+-------------------------------------------------
Changes (by Denis-de-Bernardy):
* keywords: has-patch needs-testing => needs-patch 2nd-opinion dev-
feedback
* milestone: 2.8 => Future Release
Comment:
@mzizka: here are a few nasty tests case to play with:
{{{
foo[caption id="attachment_31" align="alignleft" width="215"
caption=""foo""]<img class="size-full wp-image-31" title="test2"
src="http://localhost/~denis/wp/wp-content/uploads/2009/04/test2.jpg"
alt=""foo"" width="215" height="300" />"bar"[/caption]bar
}}}
currently outputs (with your patch):
{{{
<p>foo<div id="attachment_31" class="wp-caption alignleft" style="width:
225px"><img class="size-full wp-image-31" title="test2"
src="http://localhost/~denis/wp/wp-content/uploads/2009/04/test2.jpg"
alt=""foo"" width="215" height="300" />"bar"<p class="wp-
caption-text">"foo"</p></div>bar</p>
}}}
expected, either of:
{{{
<p>foo<div id="attachment_31" class="wp-caption alignleft" style="width:
225px"><img class="size-full wp-image-31" title="test2"
src="http://localhost/~denis/wp/wp-content/uploads/2009/04/test2.jpg"
alt=""foo"" width="215" height="300" />”bar″<p class
="wp-caption-text">"foo"</p></div>bar</p>
<p>foo<div id="attachment_31" class="wp-caption alignleft" style="width:
225px"><img class="size-full wp-image-31" title="test2"
src="http://localhost/~denis/wp/wp-content/uploads/2009/04/test2.jpg"
alt=""foo"" width="215" height="300" />"bar"<p class="wp-
caption-text">"foo"</p></div>bar</p>
}}}
the same shortcode, but this time escaped:
{{{
[[caption id="attachment_31" align="alignleft" width="215"
caption=""foo""]<img class="size-full wp-image-31" title="test2"
src="http://localhost/~denis/wp/wp-content/uploads/2009/04/test2.jpg"
alt=""foo"" width="215" height="300" />"bar"[/caption]]
}}}
currently outputs:
{{{
[caption id=”attachment_31″ align=”alignleft”
width=”215″ caption=”"foo"”]<img class
="size-full wp-image-31" title="test2" src="http://localhost/~denis/wp/wp-
content/uploads/2009/04/test2.jpg" alt=""foo"" width="215"
height="300" />“bar”[/caption]
}}}
expected, either of:
{{{
[caption id="attachment_31" align="alignleft"
width="215" caption=""foo""]<img class
="size-full wp-image-31" title="test2" src="http://localhost/~denis/wp/wp-
content/uploads/2009/04/test2.jpg" alt=""foo"" width="215"
height="300" />"bar&quot;[/caption]
[caption id="attachment_31" align="alignleft"
width="215" caption=""foo""]<img class
="size-full wp-image-31" title="test2" src="http://localhost/~denis/wp/wp-
content/uploads/2009/04/test2.jpg" alt=""foo"" width="215"
height="300" />"bar"[/caption]
}}}
itching to close this as invalid or wontfix, myself. or then, we'd want to
add some kind of special attribute that *tells* texturize what to do.
the reason is, in above, the outlined expected results could all be
expected. I used the caption shortcode from lack of a plugin around that
used shortcodes, but:
- on occasion, you'll actually want the texturizing
- on occasion, you're writing php code and don't want it to change a
thing
- on occasion, you're writing about shortcodes, using the escape method
that was recently implemented, and you expect *some* texturizing to happen
(as is done in code block). in this case the shortcode arguably gets
nested into a <pre> or <code> block (haven't tried that)
moving this to future pending dev feedback
--
Ticket URL: <http://core.trac.wordpress.org/ticket/6969#comment:27>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list