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: update punctuation regex syntax for compatibility #3540

Merged
merged 1 commit into from
Nov 20, 2024

Conversation

BlueCat0
Copy link
Contributor

Marked version: 13.0.1

Markdown flavor: Markdown.pl|CommonMark|GitHub Flavored Markdown|n/a

Description

  • as pr3229 said, the punctuation regex syntax is not supported in some browser

  • change the string to a regular expression. Then babel can transpile it correctly.

Expectation

Marked should work fine in most cases.

Result

Host environment reports error due to unsupported regex syntax.

What was attempted

-->

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.

change the string to a regular expression. Then babel can transpile it correctly.
Copy link

vercel bot commented Nov 20, 2024

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 20, 2024 1:11pm

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.

Thanks! 💯

Copy link
Member

@styfle styfle 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. I can't find any docs on which browsers we support but maybe we should add that.

@UziTech
Copy link
Member

UziTech commented Nov 20, 2024

We don't have any browser tests. I think if we are going to list specific browsers we should have some tests to make sure we are compatible.

We support node >= 18 so really we support any browsers that have the same APIs as node 18

@UziTech UziTech merged commit fd015f1 into markedjs:master Nov 20, 2024
7 checks passed
github-actions bot pushed a commit that referenced this pull request Nov 20, 2024
## [15.0.2](v15.0.1...v15.0.2) (2024-11-20)

### Bug Fixes

* update punctuation regex syntax for compatibility ([#3540](#3540)) ([fd015f1](fd015f1))
@0xDing
Copy link

0xDing commented Nov 21, 2024

我们没有进行任何浏览器测试。我认为如果我们要列出特定的浏览器,我们应该进行一些测试以确保兼容性。

我们支持 node >= 18,因此我们实际上支持任何具有与 node 18 相同 API 的浏览器

Incompatible with React Native (Hermes Engine)

@UziTech
Copy link
Member

UziTech commented Nov 21, 2024

It should work with the latest version facebook/hermes#1295

@0xDing
Copy link

0xDing commented Nov 23, 2024

It should work with the latest version facebook/hermes#1295

15.0.1 can work with the latest version of Hermes, but 15.0.2 introduced in this PR is not compatible.

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.

4 participants