Ticket #39307: 39307.patch
File 39307.patch, 1.3 KB (added by , 8 years ago) |
---|
-
src/wp-admin/js/editor.js
245 245 }); 246 246 } 247 247 248 if ( text.indexOf( '<figure' ) !== -1 ) { 249 text = text.replace( /<figure[\s\S]+?<\/figure>/g, function( a ) { 250 return a.replace( /\n+/g, '' ); 251 }); 252 } 253 248 254 text = text.replace( /<[^<>]+>/g, function( a ) { 249 255 return a.replace( /[\n\t ]+/g, ' ' ); 250 256 }); -
src/wp-includes/formatting.php
506 506 $pee = preg_replace( '%\s*(<(?:source|track)[^>]*>)\s*%', '$1', $pee ); 507 507 } 508 508 509 // Collapse line breaks inside <figure> elements, and before and after <figcaption>. 510 if ( strpos( $pee, '<figure' ) !== false ) { 511 $pee = preg_replace( '|(<figure[^>]*>)\s*|', '$1', $pee ); 512 $pee = preg_replace( '|\s*</figure>|', '</figure>', $pee ); 513 $pee = preg_replace( '|\s*(<figcaption[^>]*>)|', '$1', $pee ); 514 $pee = preg_replace( '|</figcaption>\s*|', '</figcaption>', $pee ); 515 } 516 509 517 // Remove more than two contiguous line breaks. 510 518 $pee = preg_replace("/\n\n+/", "\n\n", $pee); 511 519