tangled
alpha
login
or
join now
vielle.dev
/
core
forked from
tangled.org/core
Monorepo for Tangled — https://tangled.org
0
fork
atom
overview
issues
pulls
pipelines
appview: pages/markup: don't double camo in post process
anirudh.fi
9 months ago
58a98b87
d759587b
verified
This commit was signed with the committer's
known signature
.
anirudh.fi
SSH Key Fingerprint:
SHA256:cz35vdbiWEzCNEfuL9fMC2JVIhtXavXBHrRjv8gxpAk=
+8
-3
1 changed file
expand all
collapse all
unified
split
appview
pages
markup
markdown.go
+8
-3
appview/pages/markup/markdown.go
···
127
if attr.Key != "src" {
128
continue
129
}
130
-
attr.Val = ctx.imageFromKnotTransformer(attr.Val)
131
-
attr.Val = ctx.camoImageLinkTransformer(attr.Val)
132
-
node.Attr[i] = attr
0
0
0
0
0
133
}
134
}
135
···
127
if attr.Key != "src" {
128
continue
129
}
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
+
}
138
}
139
}
140