[wp-trac] [WordPress Trac] #6297: Unbalanced tags across more and nextpage tags
WordPress Trac
noreply at wordpress.org
Mon Jul 29 16:33:43 UTC 2013
#6297: Unbalanced tags across more and nextpage tags
-----------------------------------+------------------------------
Reporter: tellyworth | Owner:
Type: defect (bug) | Status: reopened
Priority: normal | Milestone: Awaiting Review
Component: Formatting | Version: 2.5
Severity: normal | Resolution:
Keywords: has-patch 2nd-opinion |
-----------------------------------+------------------------------
Comment (by devesine):
Replying to [comment:15 mdawaffe]:
> I don't like the "quicktags" naming. Maybe "balance_tags_delimiters"?
That seems better - when I originally wrote the patch, I mistakenly
gathered that 'quicktags' was the general name of comment tags with WP
functionality (`<!--more-->` and `<!--nextpage-->`) rather than the name
of the button bar in the editor.
> Maybe roll the `<!--` and `-->` into the values returned by the filter?
Ah, to provide more flexibility in delimiters?
Something like this, if I understand your suggestions correctly:
{{{#!php
$balance_tags_delimiters = apply_filters( 'balance_tags_delimiters',
array( '<!--more.*?-->', '<!--nextpage-->' ) );
// 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 );
}}}
--
Ticket URL: <http://core.trac.wordpress.org/ticket/6297#comment:16>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list