Make WordPress Core

Changeset 38594


Ignore:
Timestamp:
09/13/2016 06:02:23 AM (8 years ago)
Author:
pento
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/js/editor.js

    r38039 r38594  
    275275            text = text + '\n\n';
    276276            text = text.replace( /<br \/>\s*<br \/>/gi, '\n\n' );
    277             text = text.replace( new RegExp( '(<(?:' + blocklist + ')(?: [^>]*)?>)', 'gi' ), '\n$1' );
     277            text = text.replace( new RegExp( '(<(?:' + blocklist + ')(?: [^>]*)?>)', 'gi' ), '\n\n$1' );
    278278            text = text.replace( new RegExp( '(</(?:' + blocklist + ')>)', 'gi' ), '$1\n\n' );
    279279            text = text.replace( /<hr( [^>]*)?>/gi, '<hr$1>\n\n' ); // hr is self closing block element
Note: See TracChangeset for help on using the changeset viewer.