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: Add Unicode punctuations #2811

Merged
merged 1 commit into from
May 30, 2023
Merged

Conversation

azmy60
Copy link
Contributor

@azmy60 azmy60 commented May 21, 2023

Marked version: Master

Markdown flavor: Markdown.pl

Description

The Unicodes are based on this stackoverflow answer. And the reason it only goes up to \uFF65 is because javascript only supports unicode escapes up to \uFFFF.

Fixes #2531, fixes #2041.

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.

@vercel
Copy link

vercel bot commented May 21, 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 May 21, 2023 4:07pm

Copy link
Member

@UziTech UziTech left a comment

Choose a reason for hiding this comment

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

LGTM

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.

There's not any support for \p{P} in javascript, right? This is fine, but if there were a built-in standard notation that would probably be preferred.

@azmy60
Copy link
Contributor Author

azmy60 commented May 27, 2023

I tried a couple of ways to use \p{P} with 'u' flag / unicode mode, but still couldn't get it to work. 😕

Like inline._punctuation = '!"#$%&\'()+\\-.,/:;<=>?@\\[\\]`^{|}~\\p{P}'; or just inline._punctuation = '\\p{P}';

@UziTech UziTech changed the title feat: Add Unicode punctuations from \u00A1 to \uFF65 fix: Add Unicode punctuations May 30, 2023
@UziTech UziTech merged commit b213f02 into markedjs:master May 30, 2023
github-actions bot pushed a commit that referenced this pull request May 30, 2023
## [5.0.4](v5.0.3...v5.0.4) (2023-05-30)

### Bug Fixes

* Add Unicode punctuations ([#2811](#2811)) ([b213f02](b213f02))
* fix hr after list ([#2809](#2809)) ([efc40df](efc40df))
* Replace custom `repeatString` function with `repeat()` ([#2820](#2820)) ([72ee2d6](72ee2d6))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants