Open e-mail links in new tab
This commit is contained in:
parent
721c3ce3eb
commit
efaf6fd444
2 changed files with 3 additions and 1 deletions
|
@ -115,7 +115,8 @@
|
||||||
{{if .IsHTML}}
|
{{if .IsHTML}}
|
||||||
<!-- TODO: add a src fallback -->
|
<!-- TODO: add a src fallback -->
|
||||||
<!-- allow-same-origin is required to resize the frame with its content -->
|
<!-- allow-same-origin is required to resize the frame with its content -->
|
||||||
<iframe id="email-frame" srcdoc="{{.Body}}" sandbox="allow-same-origin"></iframe>
|
<!-- allow-popups is required for target="_blank" links -->
|
||||||
|
<iframe id="email-frame" srcdoc="{{.Body}}" sandbox="allow-same-origin allow-popups"></iframe>
|
||||||
{{else}}
|
{{else}}
|
||||||
<pre>{{.Body}}</pre>
|
<pre>{{.Body}}</pre>
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
|
@ -250,6 +250,7 @@ func handleGetPart(ctx *koushin.Context, raw bool) error {
|
||||||
// TODO: be more strict
|
// TODO: be more strict
|
||||||
p.AllowElements("style")
|
p.AllowElements("style")
|
||||||
p.AllowAttrs("style")
|
p.AllowAttrs("style")
|
||||||
|
p.AddTargetBlankToFullyQualifiedLinks(true)
|
||||||
body = p.Sanitize(body)
|
body = p.Sanitize(body)
|
||||||
isHTML = true
|
isHTML = true
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue