Skip to content

Commit

Permalink
Fix wrong reference that was causing go-gitea#16336
Browse files Browse the repository at this point in the history
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
  • Loading branch information
moqmar authored Jul 4, 2021
1 parent fae07cb commit a172a91
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/markup/html.go
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand All @@ -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
Expand Down

0 comments on commit a172a91

Please sign in to comment.