From 7aad618422fbea67165b8aa978606c4c76bd5cb3 Mon Sep 17 00:00:00 2001 From: Pavlo Matiash Date: Tue, 26 Jan 2021 18:21:46 +0200 Subject: [PATCH] fixed #7958 Trim all whitespace in elements written to hugo_stats.json --- publisher/htmlElementsCollector.go | 1 + 1 file changed, 1 insertion(+) diff --git a/publisher/htmlElementsCollector.go b/publisher/htmlElementsCollector.go index ace5a78b4f1..1823a832776 100644 --- a/publisher/htmlElementsCollector.go +++ b/publisher/htmlElementsCollector.go @@ -149,6 +149,7 @@ func (c *cssClassCollectorWriter) insertStandinHTMLElement(el string) (string, s if spacei != -1 { tag = tag[:spacei] } + tag = strings.Trim(tag, "\n ") newv := strings.Replace(el, tag, "div", 1) return newv, strings.ToLower(tag) }