|
@ -69,7 +69,7 @@ function ParserInline() { |
|
|
// returns `true` if any rule reported success
|
|
|
// returns `true` if any rule reported success
|
|
|
//
|
|
|
//
|
|
|
ParserInline.prototype.skipToken = function (state) { |
|
|
ParserInline.prototype.skipToken = function (state) { |
|
|
var i, pos = state.pos, |
|
|
var ok, i, pos = state.pos, |
|
|
rules = this.ruler.getRules(''), |
|
|
rules = this.ruler.getRules(''), |
|
|
len = rules.length, |
|
|
len = rules.length, |
|
|
maxNesting = state.md.options.maxNesting, |
|
|
maxNesting = state.md.options.maxNesting, |
|
@ -81,17 +81,21 @@ ParserInline.prototype.skipToken = function (state) { |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/*istanbul ignore else*/ |
|
|
|
|
|
if (state.level < maxNesting) { |
|
|
if (state.level < maxNesting) { |
|
|
for (i = 0; i < len; i++) { |
|
|
for (i = 0; i < len; i++) { |
|
|
if (rules[i](state, true)) { |
|
|
// Increment state.level and decrement it later to limit recursion.
|
|
|
cache[pos] = state.pos; |
|
|
// It's harmless to do here, because no tokens are created. But ideally,
|
|
|
return; |
|
|
// we'd need a separate private state variable for this purpose.
|
|
|
} |
|
|
//
|
|
|
|
|
|
state.level++; |
|
|
|
|
|
ok = rules[i](state, true); |
|
|
|
|
|
state.level--; |
|
|
|
|
|
|
|
|
|
|
|
if (ok) { break; } |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
state.pos++; |
|
|
if (!ok) { state.pos++; } |
|
|
cache[pos] = state.pos; |
|
|
cache[pos] = state.pos; |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|