Make WordPress Core

Ticket #27907: 27907.2.patch

File 27907.2.patch, 1.1 KB (added by Clorith, 12 years ago)

Also check if the accidental newlines are preceding the shortcode

  • trunk/wp-includes/js/shortcode.js

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    3434                                shortcode: wp.shortcode.fromMatch( match )
    3535                        };
    3636
    37                         // If we matched a leading `[`, strip it from the match
    38                         // and increment the index accordingly.
    39                         if ( match[1] ) {
     37                        // If we matched a leading `[`, and it has a matching counterpart,
     38                        // strip it from the match and increment the index accordingly.
     39                        if ( match[1] && typeof result.match !== 'undefined' ) {
    4040                                result.match = result.match.slice( 1 );
    4141                                result.index++;
    4242                        }
    4343
    44                         // If we matched a trailing `]`, strip it from the match.
    45                         if ( match[7] ) {
     44                        // If we matched a trailing `]`, , and it has a matching counterpart,
     45                        // strip it from the match.
     46                        if ( match[7] && typeof result.match !== 'undefined' ) {
    4647                                result.match = result.match.slice( 0, -1 );
    4748                        }
    4849
     50 No newline at end of file