From b2a48dce58abd3a661aa198af3277ef12f44cce0 Mon Sep 17 00:00:00 2001 From: Pavlo Matiash Date: Mon, 1 Feb 2021 10:32:39 +0200 Subject: [PATCH] Trim whitespace in elements written to hugo_stats.json Fixes #7958 --- publisher/htmlElementsCollector.go | 1 + 1 file changed, 1 insertion(+) diff --git a/publisher/htmlElementsCollector.go b/publisher/htmlElementsCollector.go index ace5a78b4..1823a8327 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) }