From d768bc93bcd0087925bcdc878456bf0016a84fc8 Mon Sep 17 00:00:00 2001 From: Feuerfuchs Date: Mon, 17 Jun 2019 15:27:14 +0200 Subject: Fix for unescaped HTML --- template.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'template.go') diff --git a/template.go b/template.go index 32b75be..781d2bb 100644 --- a/template.go +++ b/template.go @@ -21,9 +21,9 @@ var tpltext = ` {{- $content = printf "%s\n" $content -}} {{- end -}} {{- if .Link -}} - {{- $content = printf "%s%s" $content (printf "%s %s" .Type .Type .Link .Text) -}} + {{- $content = printf "%s%s" $content (printf "%s %s" .Type .Type .Link (.Text | HTMLEscape)) -}} {{- else -}} - {{- $content = printf "%s%s" $content (printf " %s" .Text) -}} + {{- $content = printf "%s%s" $content (printf " %s" (.Text | HTMLEscape)) -}} {{- end -}} {{- end -}} {{- $content | safeHtml -}} -- cgit v1.2.3-54-g00ecf