pymdown-extensions icon indicating copy to clipboard operation
pymdown-extensions copied to clipboard

MagicLink shouldn't parse links in a link

Open facelessuser opened this issue 3 years ago • 1 comments

This case incorrectly gets parsed by MagicLink and turned into a link within a link:

<a href="http://link.com">http://mdpopups.com</a>

This is incorrect, and we should be checking if the parent(s) is a link before converting.

Issue found here: https://github.com/sublimelsp/LSP/pull/1281.

facelessuser avatar Aug 30 '20 13:08 facelessuser

It should be noted that there appears to be no parent passed into the processor in which we handle this, so context is not available. We may be able to flag our links, and revert our conversion in a Treeprocessor when such context is available.

facelessuser avatar Aug 30 '20 13:08 facelessuser

I don't think there is anything we can do about this, and since GitHub behaves the same way, and they don't bother fixing it, it must not be that big of a problem for most people.

facelessuser avatar Feb 23 '23 02:02 facelessuser