-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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 emstrong unicode #3070
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
src/Tokenizer.ts
Outdated
@@ -654,8 +654,7 @@ export class _Tokenizer { | |||
|
|||
// Remove extra characters. *a*** -> *a* | |||
rLength = Math.min(rLength, rLength + delimTotal + midDelimTotal); | |||
|
|||
const raw = [...src].slice(0, lLength + match.index + rLength + 1).join(''); | |||
const raw = src.slice(0, lLength + match.index + rLength + [...match[0]][0].length); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the spread necessary here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that is so unicode character length is calculated correctly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be good to add a comment here since it’s not obvious
## [9.1.5](v9.1.4...v9.1.5) (2023-11-02) ### Bug Fixes * fix emstrong unicode ([#3070](#3070)) ([54b6d1c](54b6d1c))
Marked version: 9.1.4
Description
Fix unicode emstrong demo
Contributor
Committer
In most cases, this should be a different person than the contributor.