From ec3bf4a97a2405474d4e5a1a32ca66aec0f4fa45 Mon Sep 17 00:00:00 2001 From: Lukas Jarosch Date: Fri, 25 Aug 2023 22:35:18 +0200 Subject: [PATCH] feat: re-add html escaping --- replace.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/replace.go b/replace.go index 2034f97..d1360e2 100644 --- a/replace.go +++ b/replace.go @@ -4,6 +4,7 @@ import ( "bytes" "errors" "fmt" + "html" "strings" "sync" ) @@ -55,8 +56,7 @@ func (r *Replacer) Replace(placeholderKey string, value string) error { // ensure html escaping of special chars // reassign to prevent overwriting the actual value which would cause multiple-escapes - //tmpVal := html.EscapeString(value) - tmpVal := value + tmpVal := html.EscapeString(value) valueInBytes := bytes.Replace( []byte(tmpVal), []byte("\n"), []byte(""), -1)