Ticket #37066: 37066.3.patch
File 37066.3.patch, 762 bytes (added by , 8 years ago) |
---|
-
editor.js
221 221 // Normalize white space chars and remove multiple line breaks. 222 222 html = html.replace( /\n[\s\u00a0]+\n/g, '\n\n' ); 223 223 224 // Rrplace <br> tags with a line break. 225 html = html.replace( /\s*<br ?\/?>\s*/gi, '\n' ); 224 // Replace <br> tags with line breaks. 225 html = html.replace( /(\s*)<br ?\/?>\s*/gi, function( match, space ) { 226 if ( space && space.indexOf( '\n' ) !== -1 ) { 227 return '\n\n'; 228 } 226 229 230 return '\n'; 231 }); 232 227 233 // Fix line breaks around <div>. 228 234 html = html.replace( /\s*<div/g, '\n<div' ); 229 235 html = html.replace( /<\/div>\s*/g, '</div>\n' );