|
|
@ -25,13 +25,22 @@ function escapedSplit(str) { |
|
|
|
ch = str.charCodeAt(pos); |
|
|
|
|
|
|
|
while (pos < max) { |
|
|
|
if (ch === 0x60/* ` */ && (escapes % 2 === 0)) { |
|
|
|
backTicked = !backTicked; |
|
|
|
lastBackTick = pos; |
|
|
|
if (ch === 0x60/* ` */) { |
|
|
|
if (backTicked) { |
|
|
|
// make \` close code sequence, but not open it;
|
|
|
|
// the reason is: `\` is correct code block
|
|
|
|
backTicked = false; |
|
|
|
lastBackTick = pos; |
|
|
|
} else if (escapes % 2 === 0) { |
|
|
|
backTicked = true; |
|
|
|
lastBackTick = pos; |
|
|
|
} |
|
|
|
} else if (ch === 0x7c/* | */ && (escapes % 2 === 0) && !backTicked) { |
|
|
|
result.push(str.substring(lastPos, pos)); |
|
|
|
lastPos = pos + 1; |
|
|
|
} else if (ch === 0x5c/* \ */) { |
|
|
|
} |
|
|
|
|
|
|
|
if (ch === 0x5c/* \ */) { |
|
|
|
escapes++; |
|
|
|
} else { |
|
|
|
escapes = 0; |
|
|
|