summaryrefslogtreecommitdiffstats
path: root/markup
diff options
context:
space:
mode:
authorJoe Mooring <joe.mooring@veriphor.com>2024-12-04 14:01:31 -0800
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2024-12-09 17:58:57 +0100
commit54398f8d572c689f9785d59e907fd910a23401b0 (patch)
tree588652a17f2a93bd834471ab4181c6d77e701e22 /markup
parentb8c15f245b6989c10eaad932e19519bd8cc249e9 (diff)
downloadhugo-54398f8d572c689f9785d59e907fd910a23401b0.tar.gz
hugo-54398f8d572c689f9785d59e907fd910a23401b0.zip
tpl/tplimpl: Escape Markdown attributes in render hooks and shortcodes
Diffstat (limited to 'markup')
-rw-r--r--markup/goldmark/tables/tables_integration_test.go15
1 files changed, 8 insertions, 7 deletions
diff --git a/markup/goldmark/tables/tables_integration_test.go b/markup/goldmark/tables/tables_integration_test.go
index 85cf81c9d..36cf953ae 100644
--- a/markup/goldmark/tables/tables_integration_test.go
+++ b/markup/goldmark/tables/tables_integration_test.go
@@ -89,6 +89,12 @@ title = true
| Codecademy Hoodie | False | 42.99 |
{.foo}
+## Table 2
+
+a|b
+---|---
+1|2
+{id="\"><script>alert()</script>"}
-- layouts/_default/single.html --
Summary: {{ .Summary }}
@@ -97,7 +103,8 @@ Content: {{ .Content }}
`
b := hugolib.Test(t, files)
- b.AssertFileContent("public/p1/index.html", "<table class=\"foo\">")
+ b.AssertFileContent("public/p1/index.html", `<table class="foo">`)
+ b.AssertFileContent("public/p1/index.html", `<table id="&#34;&gt;&lt;script&gt;alert()&lt;/script&gt;">`)
}
// Issue 12811.
@@ -166,14 +173,8 @@ title: "Home"
| Codecademy Tee | False | 19.99 |
| Codecademy Hoodie | False | 42.99 |
-
-
-
-
-- layouts/index.xml --
Content: {{ .Content }}
-
-
`
b := hugolib.Test(t, files)