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 link with angle brackets around href #1851

Merged
merged 4 commits into from Dec 10, 2020

Conversation

UziTech
Copy link
Member

@UziTech UziTech commented Nov 26, 2020

Marked version: v1.2.5

Description

Fixes CommonMark tests 486, 489, 490, 491

Contributor

  • Test(s) exist to ensure functionality and minimize regression

Committer

In most cases, this should be a different person than the contributor.

@vercel
Copy link

vercel bot commented Nov 26, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/markedjs/markedjs/qhof6om3r
✅ Preview: https://markedjs-git-link-angle-brackets.markedjs.vercel.app

src/Tokenizer.js Outdated Show resolved Hide resolved

href = href.trim();
if (href.startsWith('<')) {
if (this.options.pedantic && !trimmedUrl.endsWith('>')) {
Copy link
Contributor

Choose a reason for hiding this comment

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

There are multiple (I think 3?) checks for the pedantic option. Is there some way all of the pedantic logic can be handled together?

Copy link
Member Author

Choose a reason for hiding this comment

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

That would require duplicating a lot of the logic since most of the logic is the same.

Copy link
Contributor

Choose a reason for hiding this comment

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

See my PR on your branch. Broke out my old boolean logic notes and reordered some things around. Not sure if it's "better", but it's more legible to me.

@calculuschild
Copy link
Contributor

calculuschild commented Dec 8, 2020

The lines else {title = '';} are redundant. (it's not letting me insert a comment directly)

src/Tokenizer.js Outdated Show resolved Hide resolved
@UziTech
Copy link
Member Author

UziTech commented Dec 8, 2020

I fixed return token and else { title = ''; }

@UziTech UziTech merged commit 656c3e4 into markedjs:master Dec 10, 2020
github-actions bot pushed a commit that referenced this pull request Dec 10, 2020
## [1.2.6](v1.2.5...v1.2.6) (2020-12-10)

### Bug Fixes

* fix atx heading and make regex safe ([#1853](#1853)) ([70ee29c](70ee29c))
* fix link with angle brackets around href ([#1851](#1851)) ([656c3e4](656c3e4))
@github-actions
Copy link

🎉 This PR is included in version 1.2.6 🎉

The release is available on:

Your semantic-release bot 📦🚀

@UziTech UziTech deleted the link-angle-brackets branch December 14, 2020 03:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Link URL With Spaces Does Not Render
3 participants