mirror of
https://github.com/xoofx/markdig.git
synced 2026-02-08 13:54:54 +00:00
It would be nice if autolink could be matched on more leading punctuations #235
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @jijiechen on GitHub (Oct 27, 2018).
In current implementation of Markdig as of 0.15.2, links are not automatically created if there are more kinds of leading punctuations than the ones recognized by Markdig at here:
https://github.com/lunet-io/markdig/blob/master/src/Markdig/Extensions/AutoLinks/AutoLinkParser.cs#L34
(Only whitespace,
*,*,_,~(are accepted for now).So if links could be matched and created on more kinds of leading punctuations, that'll be nice. Either list more allowed punctuations or make the
IsValidPreviousCharactermethod an instance method and overridable is helpful.I know and fully understand that it's a normal manner to put whitespaces before links in English (because links are just new words in sentences.) But in other languages, like Chinese, it's also normal there are other punctuations before links.
For instance:
Punctuations need to be matched are:
@xoofx commented on GitHub (Oct 29, 2018):
Yes, markdig should follow what GitHub is actually expecting for autolinks.
You can make a PR by changing the test:
and using a string instead:
PR welcome!
@MihaZupan commented on GitHub (Oct 29, 2018):
Would something like #264 be okay?
(Most of it is just exposing the public field)
@jijiechen commented on GitHub (Oct 29, 2018):
This is a just-pushed commit!
I think so, it should match the requirement. Many thanks!
@MihaZupan commented on GitHub (Apr 5, 2019):
Closing as resolved