mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-19 21:21:39 +02:00
tpl/tplimpl: Escape Markdown attributes in render hooks and shortcodes
This commit is contained in:
committed by
Bjørn Erik Pedersen
parent
b8c15f245b
commit
54398f8d57
@@ -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=""><script>alert()</script>">`)
|
||||
}
|
||||
|
||||
// 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)
|
||||
|
||||
|
Reference in New Issue
Block a user