Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavlo Matiash <paul.matyash@gmail.com>2021-02-01 11:32:39 +0300
committerGitHub <noreply@github.com>2021-02-01 11:32:39 +0300
commitb2a48dce58abd3a661aa198af3277ef12f44cce0 (patch)
tree68f114deb3fa2333b32228c86fffa5beddf3722c /publisher
parent35def0ae4560bb86febd12663bf5602485ad4b20 (diff)
Trim whitespace in elements written to hugo_stats.json
Fixes #7958
Diffstat (limited to 'publisher')
-rw-r--r--publisher/htmlElementsCollector.go1
1 files changed, 1 insertions, 0 deletions
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)
}