Skip to content

Commit 2b97a2a

Browse files
jmooringbep
authored andcommitted
markup/goldmark: Improve the raw HTML omitted warning
Closes #13023
1 parent 35afe6f commit 2b97a2a

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

‎markup/goldmark/goldmark_integration_test.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -821,7 +821,7 @@ title: "p1"
821821
b := hugolib.Test(t, files, hugolib.TestOptWarn())
822822

823823
b.AssertFileContent("public/p1/index.html", "<!-- raw HTML omitted -->")
824-
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']")
824+
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']")
825825

826826
b = hugolib.Test(t, strings.ReplaceAll(files, "markup.goldmark.renderer.unsafe = false", "markup.goldmark.renderer.unsafe = true"), hugolib.TestOptWarn())
827827
b.AssertFileContent("public/p1/index.html", "! <!-- raw HTML omitted -->")
@@ -845,7 +845,7 @@ title: "p1"
845845
b := hugolib.Test(t, files, hugolib.TestOptWarn())
846846

847847
b.AssertFileContent("public/p1/index.html", "<!-- raw HTML omitted -->")
848-
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']")
848+
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']")
849849

850850
b = hugolib.Test(t, strings.ReplaceAll(files, "markup.goldmark.renderer.unsafe = false", "markup.goldmark.renderer.unsafe = true"), hugolib.TestOptWarn())
851851
b.AssertFileContent("public/p1/index.html", "! <!-- raw HTML omitted -->")

‎markup/goldmark/hugocontext/hugocontext.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ func (r *hugoContextRenderer) stripHugoCtx(b []byte) ([]byte, bool) {
157157
}
158158

159159
func (r *hugoContextRenderer) logRawHTMLEmittedWarn(w util.BufWriter) {
160-
r.logger.Warnidf(constants.WarnGoldmarkRawHTML, "Raw HTML omitted from %q; see https://gohugo.io/getting-started/configuration-markup/#rendererunsafe", r.getPage(w))
160+
r.logger.Warnidf(constants.WarnGoldmarkRawHTML, "Raw HTML omitted white rendering %q; see https://gohugo.io/getting-started/configuration-markup/#rendererunsafe", r.getPage(w))
161161
}
162162

163163
func (r *hugoContextRenderer) getPage(w util.BufWriter) any {

0 commit comments

Comments
 (0)