Skip to content

[commonmark] Make link definitions commonmark compliant #1018

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

Merged
merged 8 commits into from
Jan 20, 2018

Conversation

Feder1co5oave
Copy link
Contributor

@Feder1co5oave Feder1co5oave commented Jan 19, 2018

I've made link definitions (almost 100%) compliant with the commonmark spec, and added the related test cases, from the spec itself. They all pass, but example 167 has some issue with escaping that needs some attention to be fixed.

This (conflicts with) closes #856, which goes against the cm spec.

@Feder1co5oave Feder1co5oave changed the title Make link definitions commonmark compliant [commonmark] Make link definitions commonmark compliant Jan 20, 2018
@joshbruce
Copy link
Member

LGTM! (Which probably means I'm missing something somewhere. ;) )

@joshbruce joshbruce merged commit a59837f into markedjs:master Jan 20, 2018
@Feder1co5oave Feder1co5oave deleted the new_link_def branch January 20, 2018 20:57
@Feder1co5oave
Copy link
Contributor Author

Uhm just to be precise: single quotes in link titles are not against the spec. In fact, they are supported by this PR. I forgot about this 🤔
So, everything's good in the end.

@Feder1co5oave
Copy link
Contributor Author

About this failing test, it was introduced in c3e0059:

I confirm. I should have put a note about this.
It is caused by the fact that "matched" double quotes in link titles, as in

Foo [bar](/url/ "Title with "quotes" inside").

are not supported anymore.
This is actually by design since it complies with commonmark.
They decided to go against "matching" quotes in titles and break compatibility with markdown.pl (a sensible choice, IMO). Now quotes inside titles need to be backslash escaped.

The rationale is here

@Feder1co5oave
Copy link
Contributor Author

Now that I think about this, it creates a slight incoherence in marked, because it was designed to behave exactly as markdown.pl, when in pedantic mode.

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.

2 participants