From: Pavlo Matiash Date: Mon, 1 Feb 2021 08:32:39 +0000 (+0200) Subject: Trim whitespace in elements written to hugo_stats.json X-Git-Tag: v0.81.0~47 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=b2a48dce58abd3a661aa198af3277ef12f44cce0;p=brevno-suite%2Fhugo Trim whitespace in elements written to hugo_stats.json Fixes #7958 --- diff --git a/publisher/htmlElementsCollector.go b/publisher/htmlElementsCollector.go index ace5a78b..1823a832 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) }