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 more Escape conflicts #2838

Merged
merged 3 commits into from Jun 7, 2023

Conversation

calculuschild
Copy link
Contributor

@calculuschild calculuschild commented Jun 5, 2023

Marked version: 5.0.4

Markdown flavor: GFM

Description

What was attempted

Literally the only cause of #2280 failing was because \ was not included in the punctuation list. I added that, and undid the complex solution from #2627.

Also changed the "mask out escaped EmStrong" code to mask out all escaped tokens, which handled the new test case _\\_ where the backslash is itself escaped. Could have been handled by a more complex escapedEmStrong regex, but this solution I think can apply to a few other locations where escapes come up, in a future cleanup PR, and doesn't appear to add any slowdown compared to the current solution.

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 Jun 5, 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 Jun 5, 2023 5:17pm

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.

According to recheck those regexps are safe. 👍

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.

Thanks!

@UziTech UziTech changed the title Clean up EmStrong regex / Fix more Escape conflicts fix: Fix more Escape conflicts Jun 7, 2023
@UziTech UziTech merged commit f879a23 into markedjs:master Jun 7, 2023
11 checks passed
github-actions bot pushed a commit that referenced this pull request Jun 7, 2023
## [5.0.5](v5.0.4...v5.0.5) (2023-06-07)

### Bug Fixes

* Fix more Escape conflicts ([#2838](#2838)) ([f879a23](f879a23))
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.

None yet

3 participants