Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix unicode emstrong #2989

Merged
merged 3 commits into from Sep 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
UziTech marked this conversation as resolved.
Show resolved Hide resolved

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*