From 25ac9ce62d8323af13f0ffc07c8f8e45fb1b158f Mon Sep 17 00:00:00 2001 From: Pavlo Matiash Date: Tue, 26 Jan 2021 18:21:46 +0200 Subject: [PATCH] #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..0e0e70d0e0d 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) }