helpers: Fix panic with invalid defaultMarkdownHandler

Fixes #9968
This commit is contained in:
Bjørn Erik Pedersen
2022-06-04 17:39:34 +02:00
parent c7d5f9f067
commit 311b8008bf
3 changed files with 51 additions and 4 deletions

View File

@@ -756,3 +756,29 @@ theme_param="themevalue2"
})
}
func TestInvalidDefaultMarkdownHandler(t *testing.T) {
t.Parallel()
files := `
-- config.toml --
[markup]
defaultMarkdownHandler = 'blackfriday'
-- content/_index.md --
## Foo
-- layouts/index.html --
{{ .Content }}
`
b, err := NewIntegrationTestBuilder(
IntegrationTestConfig{
T: t,
TxtarString: files,
},
).BuildE()
b.Assert(err, qt.IsNotNil)
b.Assert(err.Error(), qt.Contains, "Configured defaultMarkdownHandler \"blackfriday\" not found. Did you mean to use goldmark? Blackfriday was removed in Hugo v0.100.0.")
}