diff --git a/src/Tokenizer.ts b/src/Tokenizer.ts index 443cef4898..66fdccb82f 100644 --- a/src/Tokenizer.ts +++ b/src/Tokenizer.ts @@ -629,7 +629,7 @@ export class _Tokenizer { endReg.lastIndex = 0; // Clip maskedSrc to same section of string as src (move to lexer?) - maskedSrc = maskedSrc.slice(-1 * src.length + lLength); + maskedSrc = maskedSrc.slice(-1 * src.length + match[0].length - 1); while ((match = endReg.exec(maskedSrc)) != null) { rDelim = match[1] || match[2] || match[3] || match[4] || match[5] || match[6]; diff --git a/test/specs/new/emoji_inline.html b/test/specs/new/emoji_inline.html index d0b19a20a7..17d788c15e 100644 --- a/test/specs/new/emoji_inline.html +++ b/test/specs/new/emoji_inline.html @@ -4,8 +4,17 @@
🤓 test
🏖️ test
🏖️🤓💁 test
+💁 test test
+test 💁 test
+test 💁 test test
+test 💁
+💁 test
+💁 test test
+test 💁 test
+test 💁 test test
+💁 test
Situations where it works:
**💁 **
⚠️ test
Here, the emoji rendering works, but the text doesn't get rendered in italic.
-💁 test
\ No newline at end of file +💁 test
diff --git a/test/specs/new/emoji_inline.md b/test/specs/new/emoji_inline.md index 36f6385677..5690933d30 100644 --- a/test/specs/new/emoji_inline.md +++ b/test/specs/new/emoji_inline.md @@ -10,6 +10,24 @@ Situations where it fails: **🏖️🤓💁 test** +**💁 test** test + +test **💁 test** + +test **💁 test** test + +***test 💁*** + +***💁 test*** + +***💁 test*** test + +test ***💁 test*** + +test ***💁 test*** test + +****💁 test**** + Situations where it works: **💁 ** @@ -18,4 +36,4 @@ Situations where it works: Here, the emoji rendering works, but the text doesn't get rendered in italic. -*💁 test* \ No newline at end of file +*💁 test*