Monorepo for Tangled tangled.org

appview: pages/markup: don't double camo in post process

authored by anirudh.fi and committed by Tangled a588f625 ea4b520a

Changed files
+8 -3
appview
pages
markup
+8 -3
appview/pages/markup/markdown.go
··· 127 127 if attr.Key != "src" { 128 128 continue 129 129 } 130 - attr.Val = ctx.imageFromKnotTransformer(attr.Val) 131 - attr.Val = ctx.camoImageLinkTransformer(attr.Val) 132 - node.Attr[i] = attr 130 + 131 + camoUrl, _ := url.Parse(ctx.CamoUrl) 132 + dstUrl, _ := url.Parse(attr.Val) 133 + if dstUrl.Host != camoUrl.Host { 134 + attr.Val = ctx.imageFromKnotTransformer(attr.Val) 135 + attr.Val = ctx.camoImageLinkTransformer(attr.Val) 136 + node.Attr[i] = attr 137 + } 133 138 } 134 139 } 135 140