Skip to content

fix: fix escape characters in links#2628

Merged
UziTech merged 3 commits intomarkedjs:masterfrom
UziTech:fix-backslash
Nov 5, 2022
Merged

fix: fix escape characters in links#2628
UziTech merged 3 commits intomarkedjs:masterfrom
UziTech:fix-backslash

Conversation

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

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
Comment thread src/Tokenizer.js
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
Copy Markdown
Contributor

@calculuschild calculuschild Oct 31, 2022

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
Copy Markdown
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
Copy Markdown
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
Logiclayer1111 pushed a commit to Logiclayer1111/marked that referenced this pull request Apr 20, 2026
## [4.2.2](markedjs/marked@v4.2.1...v4.2.2) (2022-11-05)

### Bug Fixes

* fix escape characters in links ([#2628](markedjs/marked#2628)) ([f3f1c71](markedjs/marked@f3f1c71))
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