fix: fix unicode emstrong (#2989)

This commit is contained in:
Tony Brix 2023-09-16 17:24:06 -06:00 committed by GitHub
parent 56cee0a033
commit 8ebbb3c3d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 30 additions and 3 deletions

View File

@ -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];

View File

@ -4,8 +4,17 @@
<p><strong>🤓 test</strong></p>
<p><strong>🏖️ test</strong></p>
<p><strong>🏖️🤓💁 test</strong></p>
<p><strong>💁 test</strong> test</p>
<p>test <strong>💁 test</strong></p>
<p>test <strong>💁 test</strong> test</p>
<p><em><strong>test 💁</strong></em></p>
<p><em><strong>💁 test</strong></em></p>
<p><em><strong>💁 test</strong></em> test</p>
<p>test <em><strong>💁 test</strong></em></p>
<p>test <em><strong>💁 test</strong></em> test</p>
<p><strong><strong>💁 test</strong></strong></p>
<p>Situations where it works:</p>
<p>**💁 **</p>
<p><strong>⚠️ test</strong></p>
<p>Here, the emoji rendering works, but the text doesn't get rendered in italic.</p>
<p><em>💁 test</em></p>
<p><em>💁 test</em></p>

View File

@ -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*
*💁 test*