Parse shortcodes AFTER wpautop() to avoid mangling. Have wptexturize() ignore shortcodes so quotes stay straight. fixes #6444 for trunk

git-svn-id: http://svn.automattic.com/wordpress/trunk@7581 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
markjaquith 2008-03-31 07:56:58 +00:00
parent 74a7fc7923
commit 359fb2aced
2 changed files with 3 additions and 3 deletions

View File

@ -5,7 +5,7 @@ function wptexturize($text) {
$next = true;
$output = '';
$curl = '';
$textarr = preg_split('/(<.*>)/Us', $text, -1, PREG_SPLIT_DELIM_CAPTURE);
$textarr = preg_split('/(<.*>|\[.*\])/Us', $text, -1, PREG_SPLIT_DELIM_CAPTURE);
$stop = count($textarr);
// if a plugin has provided an autocorrect array, use it
@ -26,7 +26,7 @@ function wptexturize($text) {
for ( $i = 0; $i < $stop; $i++ ) {
$curl = $textarr[$i];
if (isset($curl{0}) && '<' != $curl{0} && $next) { // If it's not a tag
if (isset($curl{0}) && '<' != $curl{0} && '[' != $curl{0} && $next) { // If it's not a tag
// static strings
$curl = str_replace($static_characters, $static_replacements, $curl);
// regular expressions

View File

@ -129,6 +129,6 @@ function shortcode_atts($pairs, $atts) {
return $out;
}
add_filter( 'the_content', 'do_shortcode', 9 );
add_filter('the_content', 'do_shortcode', 11); // AFTER wpautop()
?>