Ticket #39307: 39307.2.patch
File 39307.2.patch, 1.6 KB (added by , 8 years ago) |
---|
-
src/wp-admin/js/editor.js
118 118 119 119 // Replace paragraphs with double line breaks 120 120 function removep( html ) { 121 var blocklist = 'blockquote|ul|ol|li|dl|dt|dd|table|thead|tbody|tfoot|tr|th|td|h[1-6]|fieldset ',121 var blocklist = 'blockquote|ul|ol|li|dl|dt|dd|table|thead|tbody|tfoot|tr|th|td|h[1-6]|fieldset|figure', 122 122 blocklist1 = blocklist + '|div|p', 123 123 blocklist2 = blocklist + '|pre', 124 124 preserve_linebreaks = false, … … 245 245 }); 246 246 } 247 247 248 if ( text.indexOf( '<figcaption' ) !== -1 ) { 249 text = text.replace( /\s*(<figcaption[^>]*>)/g, '$1' ); 250 text = text.replace( /<\/figcaption>\s*/g, '</figcaption>' ); 251 } 252 248 253 text = text.replace( /<[^<>]+>/g, function( a ) { 249 254 return a.replace( /[\n\t ]+/g, ' ' ); 250 255 }); -
src/wp-includes/formatting.php
506 506 $pee = preg_replace( '%\s*(<(?:source|track)[^>]*>)\s*%', '$1', $pee ); 507 507 } 508 508 509 // Collapse line breaks before and after <figcaption> elements. 510 if ( strpos( $pee, '<figcaption' ) !== false ) { 511 $pee = preg_replace( '|\s*(<figcaption[^>]*>)|', '$1', $pee ); 512 $pee = preg_replace( '|</figcaption>\s*|', '</figcaption>', $pee ); 513 } 514 509 515 // Remove more than two contiguous line breaks. 510 516 $pee = preg_replace("/\n\n+/", "\n\n", $pee); 511 517