Fix HTML entities displaying incorrectly in PDF exports
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
@@ -77,9 +77,9 @@ func TestRenderHTML(t *testing.T) {
|
||||
},
|
||||
},
|
||||
wantContains: []string{
|
||||
"Test &amp; &lt;Script&gt; Title",
|
||||
"John &lt;script&gt;alert(&#39;xss&#39;)&lt;/script&gt; Doe",
|
||||
"Alice &amp; &lt;Bob&gt;",
|
||||
"Test & <Script> Title",
|
||||
"John <script>alert('xss')</script> Doe",
|
||||
"Alice & <Bob>",
|
||||
},
|
||||
wantNotContains: []string{
|
||||
"<script>alert('xss')</script>",
|
||||
@@ -266,12 +266,12 @@ func TestHTMLEscaping(t *testing.T) {
|
||||
|
||||
resultStr := string(result)
|
||||
|
||||
// Verify dangerous content is escaped
|
||||
// Verify dangerous content is escaped
|
||||
assert.NotContains(t, resultStr, "<script>alert('xss')</script>")
|
||||
assert.NotContains(t, resultStr, "<malicious>tag")
|
||||
assert.Contains(t, resultStr, "&lt;script&gt;")
|
||||
assert.Contains(t, resultStr, "&amp;")
|
||||
assert.Contains(t, resultStr, "&#39;")
|
||||
assert.Contains(t, resultStr, "<script>")
|
||||
assert.Contains(t, resultStr, "&")
|
||||
assert.Contains(t, resultStr, "'")
|
||||
}
|
||||
|
||||
func TestMarkdownRendering(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user