mirror of
https://github.com/tulir/gomuks.git
synced 2025-04-20 10:33:41 -05:00
hicli/html: open mxc urls in new tab
This commit is contained in:
parent
ab97efbcc1
commit
e2f0ba61ac
1 changed files with 2 additions and 0 deletions
|
@ -223,6 +223,7 @@ func writeURL(w *strings.Builder, addr []byte) {
|
||||||
}
|
}
|
||||||
w.WriteString("<a")
|
w.WriteString("<a")
|
||||||
writeAttribute(w, "class", "hicli-mxc-url")
|
writeAttribute(w, "class", "hicli-mxc-url")
|
||||||
|
writeAttribute(w, "target", "_blank")
|
||||||
writeAttribute(w, "data-mxc", mxc.String())
|
writeAttribute(w, "data-mxc", mxc.String())
|
||||||
writeAttribute(w, "href", fmt.Sprintf(HTMLSanitizerImgSrcTemplate, mxc.Homeserver, mxc.FileID))
|
writeAttribute(w, "href", fmt.Sprintf(HTMLSanitizerImgSrcTemplate, mxc.Homeserver, mxc.FileID))
|
||||||
w.WriteByte('>')
|
w.WriteByte('>')
|
||||||
|
@ -405,6 +406,7 @@ func writeA(w *strings.Builder, attr []html.Attribute) (mxc id.ContentURI) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
writeAttribute(w, "class", "hicli-mxc-url")
|
writeAttribute(w, "class", "hicli-mxc-url")
|
||||||
|
writeAttribute(w, "target", "_blank")
|
||||||
writeAttribute(w, "data-mxc", mxc.String())
|
writeAttribute(w, "data-mxc", mxc.String())
|
||||||
href = fmt.Sprintf(HTMLSanitizerImgSrcTemplate, mxc.Homeserver, mxc.FileID)
|
href = fmt.Sprintf(HTMLSanitizerImgSrcTemplate, mxc.Homeserver, mxc.FileID)
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Add table
Reference in a new issue