From a172a918319b39ec77281fc98abf39028e015c92 Mon Sep 17 00:00:00 2001 From: Moritz Marquardt Date: Sun, 4 Jul 2021 10:45:56 +0200 Subject: [PATCH] Fix wrong reference that was causing #16336 node.Attr[idx].Val is not the same as attr.Val, the latter is an independent object that won't change anything in the document --- modules/markup/html.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/markup/html.go b/modules/markup/html.go index 1e55629ab5dd7..e1a6804f82064 100644 --- a/modules/markup/html.go +++ b/modules/markup/html.go @@ -375,7 +375,7 @@ func visitNode(ctx *RenderContext, procs []processor, node *html.Node, visitText } prefix = strings.Replace(prefix, "/src/", "/media/", 1) - attr.Val = util.URLJoin(prefix, attr.Val) + node.Attr[idx].Val = util.URLJoin(prefix, attr.Val) } } } else if node.Data == "a" { @@ -391,7 +391,7 @@ func visitNode(ctx *RenderContext, procs []processor, node *html.Node, visitText for i, class := range classes { if class == "icon" { classes[0], classes[i] = classes[i], classes[0] - attr.Val = strings.Join(classes, " ") + node.Attr[idx].Val = strings.Join(classes, " ") // Remove all children of icons child := node.FirstChild