Split the content to balance open tags when `<!--nextpage-->` and `<!--more.*?-->` are used. Needs filter inline docs. The 4 unit tests that were previously failing for ticket 6297 now pass.
See #6297. Props devesine. git-svn-id: https://develop.svn.wordpress.org/trunk@26050 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
c815622e87
commit
2a8b83fbb0
|
@ -1169,9 +1169,14 @@ function convert_chars($content, $deprecated = '') {
|
||||||
* @return string Balanced text
|
* @return string Balanced text
|
||||||
*/
|
*/
|
||||||
function balanceTags( $text, $force = false ) {
|
function balanceTags( $text, $force = false ) {
|
||||||
if ( $force || get_option('use_balanceTags') == 1 )
|
if ( $force || get_option('use_balanceTags') == 1 ) {
|
||||||
return force_balance_tags( $text );
|
$balance_tags_delimiters = apply_filters( 'balance_tags_delimiters', array( '<!--more.*?-->', '<!--nextpage-->' ) );
|
||||||
else
|
// Capture lets PREG_SPLIT_DELIM_CAPTURE return the delimiters
|
||||||
|
$delimiters_regex = '/(' . implode( '|', $balance_tags_delimiters ) . ')/';
|
||||||
|
$parts = preg_split( $delimiters_regex, $text, -1, PREG_SPLIT_DELIM_CAPTURE );
|
||||||
|
return implode( '', array_map( 'force_balance_tags', $parts ) );
|
||||||
|
}
|
||||||
|
|
||||||
return $text;
|
return $text;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue