From 020075e12fe4f3bc4fb632909309da97ed537c34 Mon Sep 17 00:00:00 2001 From: mrsdizzie Date: Thu, 7 Mar 2019 14:13:44 -0500 Subject: Remove visitLinksForShortLinks features (#6257) The visitLinksForShortLinks feature would look inside of an 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 because you can't have nested links within an tag. Specifically, the html5 standard says tags can't include interactive content if they contain the href attribute: http://w3c.github.io/html/single-page.html#the-a-element And also defines an element with a href attribute as interactive: http://w3c.github.io/html/single-page.html#interactive-content Therefore you can't really put a link inside of another link. In practice none of this works anyways 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. This removes the feature and also explicitly excludes the current visitNodeForShortLinks from looking in tags. --- modules/markup/html_test.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'modules/markup/html_test.go') diff --git a/modules/markup/html_test.go b/modules/markup/html_test.go index f17d00cd67..f430cb04be 100644 --- a/modules/markup/html_test.go +++ b/modules/markup/html_test.go @@ -222,4 +222,8 @@ func TestRender_ShortLinks(t *testing.T) { "[[some/path/Link #.jpg]]", `

`, `

`) + test( + "

[[foobar]]

", + `

[[foobar]]

`, + `

[[foobar]]

`) } -- cgit v1.2.3