diff --git a/src/Lexer.ts b/src/Lexer.ts index d8094d6d..9ad5feea 100644 --- a/src/Lexer.ts +++ b/src/Lexer.ts @@ -312,16 +312,17 @@ export class _Lexer { } } } - // Mask out other blocks - while ((match = this.tokenizer.rules.inline.blockSkip.exec(maskedSrc)) != null) { - maskedSrc = maskedSrc.slice(0, match.index) + '[' + 'a'.repeat(match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.blockSkip.lastIndex); - } // Mask out escaped characters while ((match = this.tokenizer.rules.inline.anyPunctuation.exec(maskedSrc)) != null) { maskedSrc = maskedSrc.slice(0, match.index) + '++' + maskedSrc.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex); } + // Mask out other blocks + while ((match = this.tokenizer.rules.inline.blockSkip.exec(maskedSrc)) != null) { + maskedSrc = maskedSrc.slice(0, match.index) + '[' + 'a'.repeat(match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.blockSkip.lastIndex); + } + let keepPrevChar = false; let prevChar = ''; while (src) { diff --git a/test/specs/new/escape_tick.html b/test/specs/new/escape_tick.html new file mode 100644 index 00000000..f04cd9b3 --- /dev/null +++ b/test/specs/new/escape_tick.html @@ -0,0 +1,9 @@ +

italics

+

bold

+

bold italics

+

*quoted italics*

+

**quoted bold**

+

***quoted bold italics***

+

`escaped quoted italics`

+

`escaped quoted bold`

+

`escaped quoted bold italics`

diff --git a/test/specs/new/escape_tick.md b/test/specs/new/escape_tick.md new file mode 100644 index 00000000..006b8eb8 --- /dev/null +++ b/test/specs/new/escape_tick.md @@ -0,0 +1,17 @@ +*italics* + +**bold** + +***bold italics*** + +`*quoted italics*` + +`**quoted bold**` + +`***quoted bold italics***` + +\`*escaped quoted italics*\` + +\`**escaped quoted bold**\` + +\`***escaped quoted bold italics***\`