-
Notifications
You must be signed in to change notification settings - Fork 50
Description
The code considers the href and text to be the same for both these cases:
(A) <a href="https://a.b.c">a.b.c</a>
(B) <a href="http://a.b.c">a.b.c</a>
Both are rendered as 'a.b.c'
However it does not consider the following to be the same:
(C) <a href="http://a.b.c/">a.b.c</a>
So the output is rendered as '[a.b.c](http://a.b.c/)'
I think the href in (A) should not be considered equal, whereas I expect (C) to render as 'a.b.c'.
For some circumstances, it might also be useful to keep the '[text](url)' format regardless of equality.
Maybe it would be useful to do the URL matching in a separate function that could optionally be provided by callers?
Additionally perhaps allow the output format to be varied, e.g. as
'text <url>' which seems to be common in text portions of mime mails.