Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Remove visitLinksForShortLinks features #6257
The visitLinksForShortLinks feature would look inside of an <a> tag and run shortLinkProcessorFull on any text, which attempts to create links out of potential 'short links' like [[test]] [[link|example]] etc... This makes no sense becaused you can't have nested links within an existing <a> tag. Specifically, the html5 standard says <a> tags can't include interactive content if they contain the href attribute:
And also defines an element with a href attribute as interactive:
Therefore you can't really put a link inside of another link as this would try. In practice none of this should work anyway since browsers won't render it, it would probably be broken if they tried, and it is causing a bug (#4946). No current tests rely on this behavior either that I can see.
This removes the feature and also explicitly excludes the current visitNodeForShortLinks from looking in <a> tags.
Open to feedback if anybody knows of a legitimate use for this, but it appears to have been added as part of a much larger commit ( 535445c) without specific explanation as to the use case behind this. Thanks!
@@ Coverage Diff @@ ## master #6257 +/- ## ======================================== Coverage ? 38.8% ======================================== Files ? 355 Lines ? 50253 Branches ? 0 ======================================== Hits ? 19502 Misses ? 27922 Partials ? 2829
It shouldn't since it only deals with the shortLinkProcessorFull function which doesn't handle any styling that I can see and returns a link when successful in any case. So all this change does is not run the following function:
... on the text inside of an existing link.