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

Props ocean90, katieburch.
Fixes #23299.

git-svn-id: https://develop.svn.wordpress.org/trunk@35999 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Pascal Birchler 2015-12-17 23:05:09 +00:00
parent 7998e04c48
commit e7417c56ce

View File

@ -118,7 +118,7 @@
// Replace paragraphs with double line breaks // Replace paragraphs with double line breaks
function removep( html ) { function removep( html ) {
var blocklist = 'blockquote|ul|ol|li|table|thead|tbody|tfoot|tr|th|td|h[1-6]|fieldset', var blocklist = 'blockquote|ul|ol|li|dl|dt|dd|table|thead|tbody|tfoot|tr|th|td|h[1-6]|fieldset',
blocklist1 = blocklist + '|div|p', blocklist1 = blocklist + '|div|p',
blocklist2 = blocklist + '|pre', blocklist2 = blocklist + '|pre',
preserve_linebreaks = false, preserve_linebreaks = false,
@ -170,7 +170,7 @@
html = html.replace( new RegExp('\\s*<((?:' + blocklist2 + ')(?: [^>]*)?)\\s*>', 'g' ), '\n<$1>' ); html = html.replace( new RegExp('\\s*<((?:' + blocklist2 + ')(?: [^>]*)?)\\s*>', 'g' ), '\n<$1>' );
html = html.replace( new RegExp('\\s*</(' + blocklist2 + ')>\\s*', 'g' ), '</$1>\n' ); html = html.replace( new RegExp('\\s*</(' + blocklist2 + ')>\\s*', 'g' ), '</$1>\n' );
html = html.replace( /<li([^>]*)>/g, '\t<li$1>' ); html = html.replace( /<((li|dt|dd)[^>]*)>/g, ' \t<$1>' );
if ( html.indexOf( '<option' ) !== -1 ) { if ( html.indexOf( '<option' ) !== -1 ) {
html = html.replace( /\s*<option/g, '\n<option' ); html = html.replace( /\s*<option/g, '\n<option' );