Options for URL matching and output
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.
Hello! I think your comment lost some of the formatting, so I can't see what the problem is - can you please repost (you may have to use backticks to force GitHub/Markdown to not format the code)? Thank you!
Oops, edited original post. Hope that is clear now.