1
0
Fork 0
forked from Mirrors/gomuks

hicli/html: open mxc urls in new tab

This commit is contained in:
Tulir Asokan 2024-10-29 14:38:23 +02:00
parent ab97efbcc1
commit e2f0ba61ac

View file

@ -223,6 +223,7 @@ func writeURL(w *strings.Builder, addr []byte) {
}
w.WriteString("<a")
writeAttribute(w, "class", "hicli-mxc-url")
writeAttribute(w, "target", "_blank")
writeAttribute(w, "data-mxc", mxc.String())
writeAttribute(w, "href", fmt.Sprintf(HTMLSanitizerImgSrcTemplate, mxc.Homeserver, mxc.FileID))
w.WriteByte('>')
@ -405,6 +406,7 @@ func writeA(w *strings.Builder, attr []html.Attribute) (mxc id.ContentURI) {
return
}
writeAttribute(w, "class", "hicli-mxc-url")
writeAttribute(w, "target", "_blank")
writeAttribute(w, "data-mxc", mxc.String())
href = fmt.Sprintf(HTMLSanitizerImgSrcTemplate, mxc.Homeserver, mxc.FileID)
default: