Formatting: make the removal of white space around <option> greedy, see #28217.

Built from https://develop.svn.wordpress.org/trunk@29316


git-svn-id: http://core.svn.wordpress.org/trunk@29097 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Ozz 2014-07-28 19:55:16 +00:00
parent ad0f539621
commit 004da2f6ba
3 changed files with 5 additions and 5 deletions

View File

@ -249,8 +249,8 @@ window.switchEditors = {
pee = pee.replace( new RegExp( '(<(?:' + blocklist + ')(?: [^>]*)?>)', 'gi' ), '\n$1' ); pee = pee.replace( new RegExp( '(<(?:' + blocklist + ')(?: [^>]*)?>)', 'gi' ), '\n$1' );
pee = pee.replace( new RegExp( '(</(?:' + blocklist + ')>)', 'gi' ), '$1\n\n' ); pee = pee.replace( new RegExp( '(</(?:' + blocklist + ')>)', 'gi' ), '$1\n\n' );
pee = pee.replace( /<hr( [^>]*)?>/gi, '<hr$1>\n\n' ); // hr is self closing block element pee = pee.replace( /<hr( [^>]*)?>/gi, '<hr$1>\n\n' ); // hr is self closing block element
pee = pee.replace( /\s<option/gi, '<option' ); // No <p> or <br> around <option> pee = pee.replace( /\s*<option/gi, '<option' ); // No <p> or <br> around <option>
pee = pee.replace( /<\/option>\s/gi, '</option>' ); pee = pee.replace( /<\/option>\s*/gi, '</option>' );
pee = pee.replace( /\r\n|\r/g, '\n' ); pee = pee.replace( /\r\n|\r/g, '\n' );
pee = pee.replace( /\n\s*\n+/g, '\n\n' ); pee = pee.replace( /\n\s*\n+/g, '\n\n' );
pee = pee.replace( /([\s\S]+?)\n\n/g, '<p>$1</p>\n' ); pee = pee.replace( /([\s\S]+?)\n\n/g, '<p>$1</p>\n' );

File diff suppressed because one or more lines are too long

View File

@ -394,8 +394,8 @@ function wpautop($pee, $br = true) {
if ( strpos( $pee, '<option' ) !== false ) { if ( strpos( $pee, '<option' ) !== false ) {
// no P/BR around option // no P/BR around option
$pee = preg_replace( '|\s<option|', '<option', $pee ); $pee = preg_replace( '|\s*<option|', '<option', $pee );
$pee = preg_replace( '|</option>\s|', '</option>', $pee ); $pee = preg_replace( '|</option>\s*|', '</option>', $pee );
} }
if ( strpos( $pee, '</object>' ) !== false ) { if ( strpos( $pee, '</object>' ) !== false ) {