Navigation Menu

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 escape characters in links #2628

Merged
merged 3 commits into from Nov 5, 2022
Merged

Conversation

UziTech
Copy link
Member

@UziTech UziTech commented Oct 27, 2022

Marked version: 4.1.1

Description

Fixes backslash escapes for common mark specs #23, #24, and #202

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 Oct 27, 2022

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

Name Status Preview Updated
marked-website ✅ Ready (Inspect) Visit Preview Oct 27, 2022 at 6:33AM (UTC)

@UziTech UziTech changed the title fix escape characters in links fix: fix escape characters in links Oct 27, 2022
@@ -103,7 +103,7 @@ export class Tokenizer {
return {
type: 'code',
raw,
lang: cap[2] ? cap[2].trim() : cap[2],
lang: cap[2] ? cap[2].trim().replace(this.rules.inline._escapes, '$1') : cap[2],
Copy link
Contributor

Choose a reason for hiding this comment

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

Would #2627 be better achieved using something like this approach, a' la DRY? #2627 works, but that regex is becoming more and more unwieldy.

Copy link
Member Author

Choose a reason for hiding this comment

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

No because that has to do with finding the correct tokens. This only works for removing escapes after the token is already found.

@UziTech
Copy link
Member Author

UziTech commented Nov 3, 2022

any objections to merging this?

@UziTech UziTech merged commit 44a2a23 into markedjs:master Nov 5, 2022
github-actions bot pushed a commit that referenced this pull request Nov 5, 2022
## [4.2.2](v4.2.1...v4.2.2) (2022-11-05)

### Bug Fixes

* fix escape characters in links ([#2628](#2628)) ([44a2a23](44a2a23))
@UziTech UziTech deleted the fix-backslash branch November 21, 2022 06:49
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