tpl/tplimpl: Deprecate comment shortcode

This commit is contained in:
Joe Mooring 2025-01-22 08:59:16 -08:00 committed by Bjørn Erik Pedersen
parent f704d75699
commit 77a8e347bc
2 changed files with 3 additions and 1 deletions

View file

@ -1 +1,2 @@
{{- warnf "The %q shortcode was deprecated in v0.143.0 and will be removed in a future release. Please use HTML comments instead. See %s" .Name .Position -}}
{{- $noop := .Inner -}} {{- $noop := .Inner -}}

View file

@ -33,8 +33,9 @@ disableKinds = ['page','rss','section','sitemap','taxonomy','term']
a{{< comment >}}b{{< /comment >}}c a{{< comment >}}b{{< /comment >}}c
` `
b := hugolib.Test(t, files) b := hugolib.Test(t, files, hugolib.TestOptWarn())
b.AssertFileContent("public/index.html", "<p>ac</p>") b.AssertFileContent("public/index.html", "<p>ac</p>")
b.AssertLogContains(`WARN The "comment" shortcode was deprecated in v0.143.0 and will be removed in a future release. Please use HTML comments instead.`)
} }
func TestDetailsShortcode(t *testing.T) { func TestDetailsShortcode(t *testing.T) {