summaryrefslogtreecommitdiffstats
path: root/hugolib/resource_chain_test.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2021-08-19 11:30:50 +0200
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2021-08-22 12:47:47 +0200
commitbc0743ed8eafc3c2d9b21a1e8f1b05d64b85e8ba (patch)
treeebdc81de4e7a616d00043cb6c6b5a8a2f2e6db5b /hugolib/resource_chain_test.go
parentffa2fe61172aa0d892234b23d1497c77a6a7f5c4 (diff)
Prevent minifier from removing quoutes around post-processed attributes
Fixes #8884
Diffstat (limited to 'hugolib/resource_chain_test.go')
-rw-r--r--hugolib/resource_chain_test.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/hugolib/resource_chain_test.go b/hugolib/resource_chain_test.go
index 834fe4357..d40d4c02e 100644
--- a/hugolib/resource_chain_test.go
+++ b/hugolib/resource_chain_test.go
@@ -457,8 +457,10 @@ func TestResourceChainPostProcess(t *testing.T) {
b := newTestSitesBuilder(t)
b.WithConfigFile("toml", `[minify]
+ minifyOutput = true
[minify.tdewolff]
[minify.tdewolff.html]
+ keepQuotes = false
keepWhitespace = false`)
b.WithContent("page1.md", "---\ntitle: Page1\n---")
b.WithContent("page2.md", "---\ntitle: Page2\n---")
@@ -473,6 +475,9 @@ HELLO: {{ $hello.RelPermalink }}
HELLO: {{ $hello.RelPermalink }}|Integrity: {{ $hello.Data.Integrity }}|MediaType: {{ $hello.MediaType.Type }}
HELLO2: Name: {{ $hello.Name }}|Content: {{ $hello.Content }}|Title: {{ $hello.Title }}|ResourceType: {{ $hello.ResourceType }}
+// Issue #8884
+<a href="hugo.rocks">foo</a>
+<a href="{{ $hello.RelPermalink }}" integrity="{{ $hello.Data.Integrity}}">Hello</a>
`+strings.Repeat("a b", rnd.Intn(10)+1)+`
@@ -484,6 +489,8 @@ End.`)
`Start.
HELLO: /hello.min.a2d1cb24f24b322a7dad520414c523e9.html|Integrity: md5-otHLJPJLMip9rVIEFMUj6Q==|MediaType: text/html
HELLO2: Name: hello.html|Content: <h1>Hello World!</h1>|Title: hello.html|ResourceType: text
+<a href=hugo.rocks>foo</a>
+<a href="/hello.min.a2d1cb24f24b322a7dad520414c523e9.html" integrity="md5-otHLJPJLMip9rVIEFMUj6Q==">Hello</a>
End.`)
b.AssertFileContent("public/page1/index.html", `HELLO: /hello.min.a2d1cb24f24b322a7dad520414c523e9.html`)