Skip to content

Commit

Permalink
fix: fix unicode emstrong (#2989)
Browse files Browse the repository at this point in the history
  • Loading branch information
UziTech committed Sep 16, 2023
1 parent 56cee0a commit 8ebbb3c
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Tokenizer.ts
Expand Up @@ -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];
Expand Down
11 changes: 10 additions & 1 deletion test/specs/new/emoji_inline.html
Expand Up @@ -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>
20 changes: 19 additions & 1 deletion test/specs/new/emoji_inline.md
Expand Up @@ -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:

**💁 **
Expand All @@ -18,4 +36,4 @@ Situations where it works:

Here, the emoji rendering works, but the text doesn't get rendered in italic.

*💁 test*
*💁 test*

1 comment on commit 8ebbb3c

@vercel
Copy link

@vercel vercel bot commented on 8ebbb3c Sep 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.