diff --git a/hugolib/site_test.go b/hugolib/site_test.go index 21029352f..effdac6df 100644 --- a/hugolib/site_test.go +++ b/hugolib/site_test.go @@ -1232,6 +1232,15 @@ disabletags = true b = r(` [build.buildStats] +enable = true +disabletags = true +disableclasses = true + `) + + b.AssertFileContent("hugo_stats.json", "! myclass", "! div", "myid") + + b = r(` +[build.buildStats] enable = false `) b.AssertDestinationExists("hugo_stats.json", false) diff --git a/publisher/htmlElementsCollector.go b/publisher/htmlElementsCollector.go index c942c46e5..c9d81818c 100644 --- a/publisher/htmlElementsCollector.go +++ b/publisher/htmlElementsCollector.go @@ -372,11 +372,6 @@ func htmlLexToEndOfComment(w *htmlElementsCollectorWriter) htmlCollectorStateFun func (w *htmlElementsCollectorWriter) parseHTMLElement(elStr string) (el htmlElement, err error) { conf := w.collector.conf - if conf.DisableTags && conf.DisableClasses { - // Nothing to do. - return - } - tagName := parseStartTag(elStr) el.Tag = strings.ToLower(tagName)