Make WordPress Core

Changeset 30406


Ignore:
Timestamp:
11/20/2014 10:59:54 AM (10 years ago)
Author:
nacin
Message:

TinyMCE: fix image captions regexp when wpautop is disabled in wp_editor().

Merges [29730] to the 4.0 branch.

props azaozz.
fixes #29592.

Location:
branches/4.0
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.0

  • branches/4.0/src/wp-includes/js/tinymce/plugins/wpeditimage/plugin.js

    r29541 r30406  
    8383            }
    8484
    85             out = b.replace( /<dl ([^>]+)>\s*<dt [^>]+>([\s\S]+?)<\/dt>\s*<dd [^>]+>([\s\S]*?)<\/dd>\s*<\/dl>/gi, function( a, b, c, caption ) {
     85            out = b.replace( /\s*<dl ([^>]+)>\s*<dt [^>]+>([\s\S]+?)<\/dt>\s*<dd [^>]+>([\s\S]*?)<\/dd>\s*<\/dl>\s*/gi, function( a, b, c, caption ) {
    8686                var id, classes, align, width;
    8787
     
    117117            });
    118118
    119             if ( out.indexOf('[caption') !== 0 ) {
     119            if ( out.indexOf('[caption') === -1 ) {
    120120                // the caption html seems broken, try to find the image that may be wrapped in a link
    121121                // and may be followed by <p> with the caption text.
Note: See TracChangeset for help on using the changeset viewer.