Closed edent closed 2 months ago
The Autolink extension follows the GFM spec which unfortunately doesn't make exceptions for autolinks found inside of HTML. You can see here that the official GFM parser behaves somewhat similarly, giving this output:
<p>
HTML <a href="https://example.com" rel="nofollow">Visit
</a><a href="https://example.com" rel="nofollow">https://example.com
</a>
</p>
So because this behavior matches both the spec and the official GFM parser I'm inclined to keep this as-is for now. But if they change this upstream in their specification I'd be glad to make this change here to remain aligned with them!
Thanks for the detailed report, though!
Thanks - that's pretty reasonable.
Version(s) affected
2.5
Description
In this HTML, the autolinker adds a nested
<a>
which is invalid.HTML <a href="https://example.com">Visit https://example.com</a>
Becomes
I would expect the autolinker to ignore the URl inside the anchor. For example, this produces correct HTML:
[Visit https://example.com](https://example.com)
How to reproduce
As per https://commonmark.thephpleague.com/2.5/extensions/autolinks/