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)
}