Changeset 40091
- Timestamp:
- 02/21/2017 03:41:42 AM (8 years ago)
- Location:
- branches/4.7
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/4.7
- Property svn:mergeinfo changed
/trunk merged: 39912,39914
- Property svn:mergeinfo changed
-
branches/4.7/src/wp-admin/js/editor.js
r38594 r40091 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', … … 256 256 return a.replace( /\n/g, '<wp-line-break>' ); 257 257 }); 258 } 259 260 if ( text.indexOf( '<figcaption' ) !== -1 ) { 261 text = text.replace( /\s*(<figcaption[^>]*>)/g, '$1' ); 262 text = text.replace( /<\/figcaption>\s*/g, '</figcaption>' ); 258 263 } 259 264 -
branches/4.7/src/wp-includes/formatting.php
r39326 r40091 505 505 $pee = preg_replace( '%\s*([<\[]/(?:audio|video)[>\]])%', '$1', $pee ); 506 506 $pee = preg_replace( '%\s*(<(?:source|track)[^>]*>)\s*%', '$1', $pee ); 507 } 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 ); 507 513 } 508 514 -
branches/4.7/tests/phpunit/tests/formatting/Autop.php
r38592 r40091 535 535 $this->assertEquals( $expected, trim( wpautop( $content ) ) ); 536 536 } 537 538 /** 539 * wpautop() should not add extra </p> before <figcaption> 540 * 541 * @covers ::wpautop 542 * @uses trim 543 * 544 * @ticket 39307 545 */ 546 function test_that_wpautop_doses_not_add_extra_closing_p_in_figure() { 547 $content1 = $expected1 = '<figure><img src="example.jpg" /><figcaption>Caption</figcaption></figure>'; 548 549 $content2 = '<figure> 550 <img src="example.jpg" /> 551 <figcaption>Caption</figcaption> 552 </figure>'; 553 554 $expected2 = '<figure> 555 <img src="example.jpg" /><figcaption>Caption</figcaption></figure>'; 556 557 $this->assertEquals( $expected1, trim( wpautop( $content1 ) ) ); 558 $this->assertEquals( $expected2, trim( wpautop( $content2 ) ) ); 559 } 560 537 561 }
Note: See TracChangeset
for help on using the changeset viewer.