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 emstrong unicode #3070

Merged
merged 2 commits into from
Nov 2, 2023
Merged

Conversation

UziTech
Copy link
Member

@UziTech UziTech commented Nov 1, 2023

Marked version: 9.1.4

Description

Fix unicode emstrong demo

Contributor

  • Test(s) exist to ensure functionality and minimize regression (if no tests added, list tests covering this PR); or,
  • no tests required for this PR.
  • If submitting new feature, it has been documented in the appropriate places.

Committer

In most cases, this should be a different person than the contributor.

Copy link

vercel bot commented Nov 1, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
marked-website ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 2, 2023 4:15am

Copy link
Contributor

@calculuschild calculuschild left a 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);
Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member

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

@UziTech UziTech merged commit 54b6d1c into markedjs:master Nov 2, 2023
10 checks passed
@UziTech UziTech deleted the fix-emstrong-unicode branch November 2, 2023 04:27
github-actions bot pushed a commit that referenced this pull request Nov 2, 2023
## [9.1.5](v9.1.4...v9.1.5) (2023-11-02)

### Bug Fixes

* fix emstrong unicode ([#3070](#3070)) ([54b6d1c](54b6d1c))
wallpants added a commit to wallpants/pantsdown that referenced this pull request Nov 6, 2023
wallpants added a commit to wallpants/pantsdown that referenced this pull request Nov 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bold hyper link with two * symbols causes one to be visible after parsing and removes space
3 participants