mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-23 15:48:43 -05:00
FIX: v8 issue with regexp
This commit is contained in:
parent
649dfd8d23
commit
7cc96bdac5
1 changed files with 4 additions and 2 deletions
6
vendor/assets/javascripts/better_markdown.js
vendored
6
vendor/assets/javascripts/better_markdown.js
vendored
|
@ -825,7 +825,6 @@
|
|||
// TODO: Cache this regexp for certain depths.
|
||||
// Create a regexp suitable for matching an li for a given stack depth
|
||||
function regex_for_depth( depth ) {
|
||||
|
||||
return new RegExp(
|
||||
// m[1] = indent, m[2] = list_type
|
||||
"(?:^(" + indent_re + "{0," + depth + "} {0,3})(" + any_list + ")\\s+)|" +
|
||||
|
@ -871,8 +870,11 @@
|
|||
replace = new RegExp("^" + indent_re + "{" + depth + "}", "gm"),
|
||||
ret = [];
|
||||
|
||||
|
||||
while ( blocks.length > 0 ) {
|
||||
if ( re.exec( blocks[0] ) ) {
|
||||
// HACK: Fixes a v8 issue
|
||||
test = blocks[0].replace(/^ {8,}/, ' ');
|
||||
if ( re.exec( test ) ) {
|
||||
var b = blocks.shift(),
|
||||
// Now remove that indent
|
||||
x = b.replace( replace, "");
|
||||
|
|
Loading…
Reference in a new issue