-
Notifications
You must be signed in to change notification settings - Fork 9
Description
If text is already in a link, it should be ignored. For example. if a document were to contain...
[@waylan](https://example.com/waylan)
The link would be parsed (as it should), and then this extension would parse the link label (@waylan) and nest a second link inside the first one, resulting in the following:
<a href="https://example.com/waylan">
<a class="gh-link gh-mention" 'href="https://github.com/waylan" title="GitHub User: @waylan">@waylan</a>
</a>In addition to the wierdness of the nested links, notice that the first link is not a GitHub mention, but something else. Of course as a workaround, you can escape the mention, like this:
[\@waylan](https://example.com/waylan)
But it should be smart enough to not insert a link inside another link. The problem is that Python-Markdown doesn't really provide a way to check that (inline patterns have no access to their parent). And it gets potentially more complicated when there is multiple levels of nesting. Consider this:
[**@waylan**](https://example.com/waylan)
The direct parent is not a link (<a> tag), but an ancestor is. Therefore, the behavior should be the same as if the direct parent was a link.