From efaf6fd4448e6e3b70f4d3cd06bf15e89d84b590 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Wed, 18 Dec 2019 16:26:46 +0100 Subject: [PATCH] Open e-mail links in new tab --- plugins/base/public/message.html | 3 ++- plugins/base/routes.go | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/base/public/message.html b/plugins/base/public/message.html index cfb0169..343f79e 100644 --- a/plugins/base/public/message.html +++ b/plugins/base/public/message.html @@ -115,7 +115,8 @@ {{if .IsHTML}} - + + {{else}}
{{.Body}}
{{end}} diff --git a/plugins/base/routes.go b/plugins/base/routes.go index 7b02f11..a5c6c21 100644 --- a/plugins/base/routes.go +++ b/plugins/base/routes.go @@ -250,6 +250,7 @@ func handleGetPart(ctx *koushin.Context, raw bool) error { // TODO: be more strict p.AllowElements("style") p.AllowAttrs("style") + p.AddTargetBlankToFullyQualifiedLinks(true) body = p.Sanitize(body) isHTML = true }