|
|
@ -52,14 +52,12 @@ module.exports = function emphasis(state, silent) { |
|
|
|
var startCount, |
|
|
|
count, |
|
|
|
found, |
|
|
|
ok, |
|
|
|
oldCount, |
|
|
|
newCount, |
|
|
|
stack, |
|
|
|
res, |
|
|
|
max = state.posMax, |
|
|
|
start = state.pos, |
|
|
|
haveLiteralAsterisk, |
|
|
|
marker = state.src.charCodeAt(start); |
|
|
|
|
|
|
|
if (marker !== 0x5F/* _ */ && marker !== 0x2A /* * */) { return false; } |
|
|
@ -83,7 +81,7 @@ module.exports = function emphasis(state, silent) { |
|
|
|
stack = [ startCount ]; |
|
|
|
|
|
|
|
while (state.pos < max) { |
|
|
|
if (state.src.charCodeAt(state.pos) === marker && !haveLiteralAsterisk) { |
|
|
|
if (state.src.charCodeAt(state.pos) === marker) { |
|
|
|
res = scanDelims(state, state.pos); |
|
|
|
count = res.delims; |
|
|
|
if (res.can_close) { |
|
|
@ -112,22 +110,9 @@ module.exports = function emphasis(state, silent) { |
|
|
|
state.pos += count; |
|
|
|
continue; |
|
|
|
} |
|
|
|
|
|
|
|
if (res.can_open) { |
|
|
|
stack.push(count); |
|
|
|
state.pos += count; |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
ok = state.parser.skipToken(state); |
|
|
|
|
|
|
|
if (ok) { |
|
|
|
haveLiteralAsterisk = false; |
|
|
|
} else { |
|
|
|
haveLiteralAsterisk = state.src.charCodeAt(state.pos) === marker; |
|
|
|
state.pos++; |
|
|
|
} |
|
|
|
if (!state.parser.skipToken(state)) { state.pos++; } |
|
|
|
} |
|
|
|
|
|
|
|
if (!found) { |
|
|
|