UseAutoLinks would be nice if it excluded punctuation like github #155

Closed
opened 2026-01-29 14:29:07 +00:00 by claunia · 3 comments
Owner

Originally created by @topherdavis on GitHub (Nov 9, 2017).

People will frequently terminate a sentence or join a sentence fragment by referring to url. Github excludes these punctuation marks from the autolink, but Markdig doesn't. It would be great if they were excluded from the autolink.

Examples of usage:

I found it at http://www.travefy.com!

I went to http://www.travefy.com, but didn't find what I was looking for.

In the end of url example Markdig does not match the github style:

Markdig style:
http://www.travefy.com! -> <p><a href="http://www.travefy.com!">http://www.travefy.com!</a></p>

Github style:
http://www.travefy.com! -> <p><a href="http://www.travefy.com">http://www.travefy.com</a>!</p>

In the intra-url example Markdig matches the github style:

Markdig style:
http://www.travefy.com!/foo -> <p><a href="http://www.travefy.com!/foo">http://www.travefy.com!/foo</a></p>

Github style:
http://www.travefy.com!/foo -> <p><a href="http://www.travefy.com!/foo">http://www.travefy.com!/foo</a></p>

Originally created by @topherdavis on GitHub (Nov 9, 2017). People will frequently terminate a sentence or join a sentence fragment by referring to url. Github excludes these punctuation marks from the autolink, but Markdig doesn't. It would be great if they were excluded from the autolink. Examples of usage: > I found it at http://www.travefy.com! >I went to http://www.travefy.com, but didn't find what I was looking for. In the end of url example Markdig does not match the github style: Markdig style: `http://www.travefy.com!` -> `<p><a href="http://www.travefy.com!">http://www.travefy.com!</a></p>` Github style: `http://www.travefy.com!` -> `<p><a href="http://www.travefy.com">http://www.travefy.com</a>!</p>` In the intra-url example Markdig matches the github style: Markdig style: `http://www.travefy.com!/foo` -> `<p><a href="http://www.travefy.com!/foo">http://www.travefy.com!/foo</a></p>` Github style: `http://www.travefy.com!/foo` -> `<p><a href="http://www.travefy.com!/foo">http://www.travefy.com!/foo</a></p>`
claunia added the enhancementPR Welcome! labels 2026-01-29 14:29:07 +00:00
Author
Owner

@xoofx commented on GitHub (Nov 9, 2017):

I agree. Currently no time to work on this, but PR welcome.

@xoofx commented on GitHub (Nov 9, 2017): I agree. Currently no time to work on this, but PR welcome.
Author
Owner

@xoofx commented on GitHub (Nov 10, 2017):

Actually github has now a commonmark extension spec for autolink but need also to follow this issue https://github.com/github/cmark/issues/27

@xoofx commented on GitHub (Nov 10, 2017): Actually github has now a [commonmark extension spec for autolink](https://github.github.com/gfm/#autolinks-extension-) but need also to follow this issue https://github.com/github/cmark/issues/27
Author
Owner

@xoofx commented on GitHub (Nov 17, 2017):

Fixed by commit 964538e

@xoofx commented on GitHub (Nov 17, 2017): Fixed by commit 964538e
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/markdig#155