Handle KaTeX warnings (#13760)

Co-authored-by: Joe Mooring <joe.mooring@veriphor.com>

Fixes #13735
This commit is contained in:
Bjørn Erik Pedersen
2025-05-30 20:57:54 +02:00
committed by GitHub
parent 75259636c8
commit 6334948515
10 changed files with 76 additions and 15 deletions

View File

@@ -525,11 +525,10 @@ disableKinds = ['page','rss','section','sitemap','taxonomy','term']
b.AssertFileContent("public/index.html", `<annotation encoding="application/x-tex">a %</annotation>`)
// strict: warn
// TODO: see https://github.com/gohugoio/hugo/issues/13735
// f = strings.ReplaceAll(files, "dict", `(dict "strict" "warn")`)
// b = hugolib.Test(t, f, hugolib.TestOptWarn())
// b.AssertLogMatches("[commentAtEnd]")
// b.AssertFileContent("public/index.html", `<annotation encoding="application/x-tex">a %</annotation>`)
f = strings.ReplaceAll(files, "dict", `(dict "strict" "warn")`)
b = hugolib.Test(t, f, hugolib.TestOptWarn())
b.AssertLogMatches("[commentAtEnd]")
b.AssertFileContent("public/index.html", `<annotation encoding="application/x-tex">a %</annotation>`)
// strict mode: invalid value
f = strings.ReplaceAll(files, "dict", `(dict "strict" "foo")`)