summaryrefslogtreecommitdiffstats
path: root/markup/goldmark/codeblocks/integration_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'markup/goldmark/codeblocks/integration_test.go')
-rw-r--r--markup/goldmark/codeblocks/integration_test.go29
1 files changed, 17 insertions, 12 deletions
diff --git a/markup/goldmark/codeblocks/integration_test.go b/markup/goldmark/codeblocks/integration_test.go
index 68f6b809e..c33ea31e3 100644
--- a/markup/goldmark/codeblocks/integration_test.go
+++ b/markup/goldmark/codeblocks/integration_test.go
@@ -14,6 +14,7 @@
package codeblocks_test
import (
+ "strings"
"testing"
"github.com/gohugoio/hugo/hugolib"
@@ -176,7 +177,7 @@ Position: {{ .Position | safeHTML }}
}
// Issue 9571
-func TestOptionsNonChroma(t *testing.T) {
+func TestAttributesChroma(t *testing.T) {
t.Parallel()
files := `
@@ -188,23 +189,27 @@ title: "p1"
## Code
-§§§bash {style=monokai}
+§§§LANGUAGE {style=monokai}
echo "p1";
§§§
-- layouts/_default/single.html --
{{ .Content }}
-- layouts/_default/_markup/render-codeblock.html --
-Style: {{ .Attributes }}|
+Attributes: {{ .Attributes }}|Options: {{ .Options }}|
`
-
- b := hugolib.NewIntegrationTestBuilder(
- hugolib.IntegrationTestConfig{
- T: t,
- TxtarString: files,
- },
- ).Build()
-
- b.AssertFileContent("public/p1/index.html", "asdfadf")
+ testLanguage := func(language, expect string) {
+ b := hugolib.NewIntegrationTestBuilder(
+ hugolib.IntegrationTestConfig{
+ T: t,
+ TxtarString: strings.ReplaceAll(files, "LANGUAGE", language),
+ },
+ ).Build()
+
+ b.AssertFileContent("public/p1/index.html", expect)
+ }
+
+ testLanguage("bash", "Attributes: map[]|Options: map[style:monokai]|")
+ testLanguage("hugo", "Attributes: map[style:monokai]|Options: map[]|")
}