Shortcode JS: Avoid errors when an escaped shortcode includes a newline between brackets.

props gcorne.
props Clorith, jorbin for tests.
see #27907, for trunk.


git-svn-id: https://develop.svn.wordpress.org/trunk@28223 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin
2014-05-01 03:36:27 +00:00
parent 5907cafe9e
commit 790cb99b27
2 changed files with 33 additions and 3 deletions
+3 -3
View File
@@ -37,13 +37,13 @@ window.wp = window.wp || {};
// If we matched a leading `[`, strip it from the match
// and increment the index accordingly.
if ( match[1] ) {
result.match = result.match.slice( 1 );
result.content = result.content.slice( 1 );
result.index++;
}
// If we matched a trailing `]`, strip it from the match.
if ( match[7] ) {
result.match = result.match.slice( 0, -1 );
result.content = result.content.slice( 0, -1 );
}
return result;
@@ -353,4 +353,4 @@ window.wp = window.wp || {};
return text + '</' + options.tag + '>';
}
});
}());
}());