aboutsummaryrefslogtreecommitdiffhomepage
path: root/tpl/transform/transform_integration_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'tpl/transform/transform_integration_test.go')
-rw-r--r--tpl/transform/transform_integration_test.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/tpl/transform/transform_integration_test.go b/tpl/transform/transform_integration_test.go
index b030417a2..9e5221c9a 100644
--- a/tpl/transform/transform_integration_test.go
+++ b/tpl/transform/transform_integration_test.go
@@ -149,3 +149,24 @@ disableKinds = ['page','rss','section','sitemap','taxonomy','term']
<span class="katex"><math
`)
}
+
+func TestToMathMacros(t *testing.T) {
+ t.Parallel()
+
+ files := `
+-- hugo.toml --
+disableKinds = ['page','rss','section','sitemap','taxonomy','term']
+-- layouts/index.html --
+{{ $macros := dict
+ "\\addBar" "\\bar{#1}"
+ "\\bold" "\\mathbf{#1}"
+}}
+{{ $opts := dict "macros" $macros }}
+{{ transform.ToMath "\\addBar{y} + \\bold{H}" $opts }}
+ `
+ b := hugolib.Test(t, files)
+
+ b.AssertFileContent("public/index.html", `
+<mi>y</mi>
+ `)
+}