Ticket #6297: balanceTags_quicktags-trunk.patch
| File balanceTags_quicktags-trunk.patch, 825 bytes (added by , 14 years ago) |
|---|
-
wp-includes/formatting.php
1062 1062 function balanceTags( $text, $force = false ) { 1063 1063 if ( !$force && get_option('use_balanceTags') == 0 ) 1064 1064 return $text; 1065 return force_balance_tags( $text ); 1065 $quicktags = apply_filters( 'balancetags_quicktags', array( 'more.*?', 'nextpage' ) ); 1066 // Outer capture lets PREG_SPLIT_DELIM_CAPTURE return the quicktags 1067 // Inner noncapturing group matches any of the defined quicktags 1068 $quicktag_regex = '/(<!--(?:' . implode('|', $quicktags) . ')-->)/'; 1069 $parts = preg_split($quicktag_regex, $text, -1, PREG_SPLIT_DELIM_CAPTURE); 1070 return implode('', array_map('force_balance_tags', $parts)); 1066 1071 } 1067 1072 1068 1073 /**