WordPress.org

Make WordPress Core

Changeset 35999


Ignore:
Timestamp:
12/17/2015 11:05:09 PM (6 years ago)
Author:
swissspidy
Message:

Editor: Correctly indent definition lists when switching from the visual to the text editor.

Props ocean90, katieburch.
Fixes #23299.

File:
1 edited

Legend:

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

    r35727 r35999  
    119119        // Replace paragraphs with double line breaks
    120120        function removep( html ) {
    121             var blocklist = 'blockquote|ul|ol|li|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',
    122122                blocklist1 = blocklist + '|div|p',
    123123                blocklist2 = blocklist + '|pre',
     
    171171            html = html.replace( new RegExp('\\s*<((?:' + blocklist2 + ')(?: [^>]*)?)\\s*>', 'g' ), '\n<$1>' );
    172172            html = html.replace( new RegExp('\\s*</(' + blocklist2 + ')>\\s*', 'g' ), '</$1>\n' );
    173             html = html.replace( /<li([^>]*)>/g, '\t<li$1>' );
     173            html = html.replace( /<((li|dt|dd)[^>]*)>/g, ' \t<$1>' );
    174174
    175175            if ( html.indexOf( '<option' ) !== -1 ) {
Note: See TracChangeset for help on using the changeset viewer.