Make WordPress Core

Ticket #20943: 20943.3.diff

File 20943.3.diff, 651 bytes (added by alleynoah, 10 years ago)

JS tweak to preserve line breaks in table cells in pre_wpautop

  • src/wp-admin/js/editor.js

     
    150150                // Mark </p> if it has any attributes.
    151151                content = content.replace( /(<p [^>]+>.*?)<\/p>/g, '$1</p#>' );
    152152
    153                 // Separate <div> containing <p>
    154                 content = content.replace( /<div( [^>]*)?>\s*<p>/gi, '<div$1>\n\n' );
     153                // Separate <div> and table cell elements containing <p>
     154                content = content.replace( /<(div|td|th)( [^>]*)?>\s*<p>/gi, '<$1$2>\n\n' );
    155155
    156156                // Remove <p> and <br />
    157157                content = content.replace( /\s*<p>/gi, '' );