Formatting: Update `autop()` to match `wpautop()`.

[38592] changed the behaviour of `wpautop()` , so it's nice to change `autop()` to match.

Interestingly, this change isn't necessary for the functionality to work - #4857 didn't affect content that had been run through `autop()` at some point, as `autop()` would add a single line break before block elements, then `wpautop()` would later add a second line break, making it work correctly.

Props nacin for finding out about [38592] on Twitter, and DMing me to remind me to review `autop()`.
See #4857.



git-svn-id: https://develop.svn.wordpress.org/trunk@38594 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Gary Pendergast 2016-09-13 06:02:23 +00:00
parent 52c566f5dc
commit 2950eb8ea2
1 changed files with 1 additions and 1 deletions

View File

@ -274,7 +274,7 @@
text = text + '\n\n';
text = text.replace( /<br \/>\s*<br \/>/gi, '\n\n' );
text = text.replace( new RegExp( '(<(?:' + blocklist + ')(?: [^>]*)?>)', 'gi' ), '\n$1' );
text = text.replace( new RegExp( '(<(?:' + blocklist + ')(?: [^>]*)?>)', 'gi' ), '\n\n$1' );
text = text.replace( new RegExp( '(</(?:' + blocklist + ')>)', 'gi' ), '$1\n\n' );
text = text.replace( /<hr( [^>]*)?>/gi, '<hr$1>\n\n' ); // hr is self closing block element
text = text.replace( /\s*<option/gi, '<option' ); // No <p> or <br> around <option>