Trim whitespace in elements written to hugo_stats.json
authorPavlo Matiash <paul.matyash@gmail.com>
Mon, 1 Feb 2021 08:32:39 +0000 (10:32 +0200)
committerGitHub <noreply@github.com>
Mon, 1 Feb 2021 08:32:39 +0000 (09:32 +0100)
Fixes #7958

publisher/htmlElementsCollector.go

index ace5a78b4f13cbe0adf3f8730ceb546995f3795f..1823a832776a234f3eee574e867147cefeb71ab1 100644 (file)
@@ -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)
 }