diff options
author | Joe Mooring <[email protected]> | 2024-11-07 12:19:59 -0800 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2024-11-07 23:00:09 +0200 |
commit | 2b97a2a8bf2dbb9c8277b14f7f7bf824b5a58516 (patch) | |
tree | d73edfe2d972440b46a380f72ad7f0c83eb3a417 | |
parent | 35afe6fe2ab6b29f4cc1a538ff245ee66b067dd8 (diff) | |
download | hugo-2b97a2a8bf2dbb9c8277b14f7f7bf824b5a58516.tar.gz hugo-2b97a2a8bf2dbb9c8277b14f7f7bf824b5a58516.zip |
markup/goldmark: Improve the raw HTML omitted warning
Closes #13023
-rw-r--r-- | markup/goldmark/goldmark_integration_test.go | 4 | ||||
-rw-r--r-- | markup/goldmark/hugocontext/hugocontext.go | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/markup/goldmark/goldmark_integration_test.go b/markup/goldmark/goldmark_integration_test.go index 82579069b..17b76360d 100644 --- a/markup/goldmark/goldmark_integration_test.go +++ b/markup/goldmark/goldmark_integration_test.go @@ -821,7 +821,7 @@ title: "p1" b := hugolib.Test(t, files, hugolib.TestOptWarn()) b.AssertFileContent("public/p1/index.html", "<!-- raw HTML omitted -->") - b.AssertLogContains("WARN Raw HTML omitted from \"/content/p1.md\"; see https://gohugo.io/getting-started/configuration-markup/#rendererunsafe\nYou can suppress this warning by adding the following to your site configuration:\nignoreLogs = ['warning-goldmark-raw-html']") + b.AssertLogContains("WARN Raw HTML omitted white rendering \"/content/p1.md\"; see https://gohugo.io/getting-started/configuration-markup/#rendererunsafe\nYou can suppress this warning by adding the following to your site configuration:\nignoreLogs = ['warning-goldmark-raw-html']") b = hugolib.Test(t, strings.ReplaceAll(files, "markup.goldmark.renderer.unsafe = false", "markup.goldmark.renderer.unsafe = true"), hugolib.TestOptWarn()) b.AssertFileContent("public/p1/index.html", "! <!-- raw HTML omitted -->") @@ -845,7 +845,7 @@ title: "p1" b := hugolib.Test(t, files, hugolib.TestOptWarn()) b.AssertFileContent("public/p1/index.html", "<!-- raw HTML omitted -->") - b.AssertLogContains("WARN Raw HTML omitted from \"/content/p1.md\"; see https://gohugo.io/getting-started/configuration-markup/#rendererunsafe\nYou can suppress this warning by adding the following to your site configuration:\nignoreLogs = ['warning-goldmark-raw-html']") + b.AssertLogContains("WARN Raw HTML omitted white rendering \"/content/p1.md\"; see https://gohugo.io/getting-started/configuration-markup/#rendererunsafe\nYou can suppress this warning by adding the following to your site configuration:\nignoreLogs = ['warning-goldmark-raw-html']") b = hugolib.Test(t, strings.ReplaceAll(files, "markup.goldmark.renderer.unsafe = false", "markup.goldmark.renderer.unsafe = true"), hugolib.TestOptWarn()) b.AssertFileContent("public/p1/index.html", "! <!-- raw HTML omitted -->") diff --git a/markup/goldmark/hugocontext/hugocontext.go b/markup/goldmark/hugocontext/hugocontext.go index a10e095ef..4098392c4 100644 --- a/markup/goldmark/hugocontext/hugocontext.go +++ b/markup/goldmark/hugocontext/hugocontext.go @@ -157,7 +157,7 @@ func (r *hugoContextRenderer) stripHugoCtx(b []byte) ([]byte, bool) { } func (r *hugoContextRenderer) logRawHTMLEmittedWarn(w util.BufWriter) { - r.logger.Warnidf(constants.WarnGoldmarkRawHTML, "Raw HTML omitted from %q; see https://gohugo.io/getting-started/configuration-markup/#rendererunsafe", r.getPage(w)) + r.logger.Warnidf(constants.WarnGoldmarkRawHTML, "Raw HTML omitted white rendering %q; see https://gohugo.io/getting-started/configuration-markup/#rendererunsafe", r.getPage(w)) } func (r *hugoContextRenderer) getPage(w util.BufWriter) any { |