Skip to content

Parse GFM Extended autolinks#71

Draft
stephenreddek wants to merge 21 commits intodillonkearns:masterfrom
stephenreddek:extended-autolinks
Draft

Parse GFM Extended autolinks#71
stephenreddek wants to merge 21 commits intodillonkearns:masterfrom
stephenreddek:extended-autolinks

Conversation

@stephenreddek
Copy link
Copy Markdown
Contributor

This ends up breaking tests around the standard autolinks which assert that if it isn't exactly between <> then it shouldn't result in a link.

GFM test 628 isn't passing yet because of my strict interpretation of only allowing http and https. I have written out a question about that in the issue (#57 ). it is trivial to add support for ftp, but opens up the question of what else is possible to support.

I'm still working on how to strip out autolink tokens from html anchor nodes, but I think there's enough here for discussion.

Comment thread test-results/failing/New/double_link.md Outdated

````````````html
<p><p>Already linked:</p><a href="http://example.com/"><p>http://example.com/</p></a><p>.</p></p><p>Already linked:<a href="http://example.com/">http://example.com/</a>.</p><p>Already linked:<a href="http://example.com/"><p><strong>http://example.com/</strong></p></a>.</p>
<p><p>Already linked:</p><a href="http://example.com/"><p><a href="http://example.com/">http://example.com/</a></p></a><p>.</p></p><p>Already linked:<a href="http://example.com/">http://example.com/</a>.</p><p>Already linked:<a href="http://example.com/"><p><strong><a href="http://example.com/">http://example.com/</a></strong></p></a>.</p>
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This test still needs to be fixed.

Comment thread test-results/failing/New/autolinks.md Outdated

extendedAutoLinkRegex : Regex
extendedAutoLinkRegex =
-- what if we do this without the negative lookbehind and just make it a sub match?
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Resolve this question


extendedAutoLinkTrailingPunctuationRegex : Regex
extendedAutoLinkTrailingPunctuationRegex =
--should this use the isPunctuation helper?
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Resolve


````````````html
<p>a.b-c_d@a.b</p><p>a.b-c_d@a.b.</p><p>a.b-c_d@a.b-</p><p>a.b-c_d@a.b_</p>
<p><a href="http://commonmark.org">http://commonmark.org</a></p><p>(Visit<a href="https://encrypted.google.com/search?q=Markup+(business)">https://encrypted.google.com/search?q=Markup+(business)</a>)</p><p>Anonymous FTP is available at ftp://foo.bar.baz.</p>
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Only failing because we restricted autolinks to http and https

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.

1 participant