-
-
Notifications
You must be signed in to change notification settings - Fork 31
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
Parse GFM Extended autolinks #71
base: master
Are you sure you want to change the base?
Parse GFM Extended autolinks #71
Conversation
…inks so that we don't have double links
@@ -22,5 +22,5 @@ Should give output: | |||
But instead was: | |||
|
|||
````````````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> |
There was a problem hiding this comment.
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.
|
||
extendedAutoLinkRegex : Regex | ||
extendedAutoLinkRegex = | ||
-- what if we do this without the negative lookbehind and just make it a sub match? |
There was a problem hiding this comment.
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? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolve
…into extended-autolinks
|
||
````````````html | ||
<p>[email protected]</p><p>[email protected].</p><p>[email protected]</p><p>[email protected]_</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> |
There was a problem hiding this comment.
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
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.