Parse GFM Extended autolinks#71
Draft
stephenreddek wants to merge 21 commits intodillonkearns:masterfrom
Draft
Conversation
…inks so that we don't have double links
stephenreddek
commented
Feb 12, 2021
|
|
||
| ````````````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> |
Contributor
Author
There was a problem hiding this comment.
This test still needs to be fixed.
stephenreddek
commented
Feb 12, 2021
stephenreddek
commented
Feb 12, 2021
|
|
||
| extendedAutoLinkRegex : Regex | ||
| extendedAutoLinkRegex = | ||
| -- what if we do this without the negative lookbehind and just make it a sub match? |
Contributor
Author
There was a problem hiding this comment.
Resolve this question
stephenreddek
commented
Feb 12, 2021
|
|
||
| extendedAutoLinkTrailingPunctuationRegex : Regex | ||
| extendedAutoLinkTrailingPunctuationRegex = | ||
| --should this use the isPunctuation helper? |
…into extended-autolinks
stephenreddek
commented
Feb 13, 2021
|
|
||
| ````````````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> |
Contributor
Author
There was a problem hiding this comment.
Only failing because we restricted autolinks to http and https
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.