Skip to content

fix: Fix more Escape conflicts#2838

Merged
UziTech merged 3 commits intomarkedjs:masterfrom
calculuschild:CleanUpEmStrong
Jun 7, 2023
Merged

fix: Fix more Escape conflicts#2838
UziTech merged 3 commits intomarkedjs:masterfrom
calculuschild:CleanUpEmStrong

Conversation

@calculuschild
Copy link
Copy Markdown
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
Copy Markdown

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
Copy Markdown
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
Copy Markdown
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
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))
Logiclayer1111 pushed a commit to Logiclayer1111/marked that referenced this pull request Apr 20, 2026
## [5.0.5](markedjs/marked@v5.0.4...v5.0.5) (2023-06-07)

### Bug Fixes

* Fix more Escape conflicts ([#2838](markedjs/marked#2838)) ([96d26b8](markedjs/marked@96d26b8))
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.

3 participants