Fix class collector when running with --minify

Also add a related stresstest.

Fixes #7161
This commit is contained in:
Bjørn Erik Pedersen
2020-04-21 12:57:45 +02:00
parent 27af5a339a
commit f37e77f2d3
3 changed files with 116 additions and 15 deletions

View File

@@ -51,6 +51,8 @@ func TestClassCollector(t *testing.T) {
{"duplicates", `<div class="b a b"></div>`, f("div", "a b", "")},
{"single quote", `<body class='b a'></body>`, f("body", "a b", "")},
{"no quote", `<body class=b id=myelement></body>`, f("body", "b", "myelement")},
// https://github.com/gohugoio/hugo/issues/7161
{"minified a href", `<a class="b a" href=/></a>`, f("a", "a b", "")},
{"AlpineJS bind 1", `<body>
<div x-bind:class="{