WordPress.org

Make WordPress Core

Ticket #25646: figcaption-not-block-fixed.25646.diff

File figcaption-not-block-fixed.25646.diff, 1.8 KB (added by oso96_2000, 8 years ago)

Patch with both instances (formatting.php and editor.js) modified.

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

    diff --git src/wp-admin/js/editor.js src/wp-admin/js/editor.js
    index e2b39ca..3702a77 100644
    window.switchEditors = { 
    205205                        preserve_br = false,
    206206                        blocklist = 'table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select' +
    207207                                '|option|form|map|area|blockquote|address|math|style|p|h[1-6]|hr|fieldset|noscript|legend|section' +
    208                                 '|article|aside|hgroup|header|footer|nav|figure|figcaption|details|menu|summary';
     208                                '|article|aside|hgroup|header|footer|nav|figure|details|menu|summary';
    209209
    210210                if ( pee.indexOf( '<object' ) !== -1 ) {
    211211                        pee = pee.replace( /<object[\s\S]+?<\/object>/g, function( a ) {
  • src/wp-includes/formatting.php

    diff --git src/wp-includes/formatting.php src/wp-includes/formatting.php
    index 27d64e1..072c796 100644
    function wpautop($pee, $br = true) { 
    234234
    235235        $pee = preg_replace('|<br />\s*<br />|', "\n\n", $pee);
    236236        // Space things out a little
    237         $allblocks = '(?:table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|option|form|map|area|blockquote|address|math|style|p|h[1-6]|hr|fieldset|noscript|legend|section|article|aside|hgroup|header|footer|nav|figure|figcaption|details|menu|summary)';
     237        $allblocks = '(?:table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|option|form|map|area|blockquote|address|math|style|p|h[1-6]|hr|fieldset|noscript|legend|section|article|aside|hgroup|header|footer|nav|figure|details|menu|summary)';
    238238        $pee = preg_replace('!(<' . $allblocks . '[^>]*>)!', "\n$1", $pee);
    239239        $pee = preg_replace('!(</' . $allblocks . '>)!', "$1\n\n", $pee);
    240240        $pee = str_replace(array("\r\n", "\r"), "\n", $pee); // cross-platform newlines