mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 12:20:22 +00:00
Formatting: Add an extra line break before block elements in wpautop().
`wpautop()` considers double line breaks to be the separator between block level HTML elements. By adding two line breaks before a block element, this allows us to process the text before a block element correctly. Fixes #4857. git-svn-id: https://develop.svn.wordpress.org/trunk@38592 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -524,4 +524,14 @@ line 2<br/>
|
||||
$this->assertEquals( $expected, trim( wpautop( $content ) ) );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @ticket 4857
|
||||
*/
|
||||
function test_that_text_before_blocks_is_peed() {
|
||||
$content = 'a<div>b</div>';
|
||||
$expected = "<p>a</p>\n<div>b</div>";
|
||||
|
||||
$this->assertEquals( $expected, trim( wpautop( $content ) ) );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user