aboutsummaryrefslogtreecommitdiff
path: root/reamde_to_html.go
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2025-03-06 21:10:22 +0800
committerRunxi Yu <me@runxiyu.org>2025-03-06 21:10:22 +0800
commit39aba302878fcffba7496d0892268c8f1467fcd2 (patch)
tree5c80ebd5d844f41393515c430036f5707942b522 /reamde_to_html.go
parentlint: Add lint script (diff)
downloadforge-39aba302878fcffba7496d0892268c8f1467fcd2.tar.gz
forge-39aba302878fcffba7496d0892268c8f1467fcd2.tar.zst
forge-39aba302878fcffba7496d0892268c8f1467fcd2.zip
repo/tree, readme: nosec G203
Diffstat (limited to 'reamde_to_html.go')
-rw-r--r--reamde_to_html.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/reamde_to_html.go b/reamde_to_html.go
index 4564344..29c61ca 100644
--- a/reamde_to_html.go
+++ b/reamde_to_html.go
@@ -29,7 +29,7 @@ func render_readme_at_tree(tree *object.Tree) (readme_filename string, readme_co
return "Error fetching README", string_escape_html("Unable to fetch contents of README: " + err.Error())
}
- return "README", template.HTML("<pre>" + html.EscapeString(readme_file_contents) + "</pre>")
+ return "README", template.HTML("<pre>" + html.EscapeString(readme_file_contents) + "</pre>") //#nosec G203
}
if readme_file, err = tree.File("README.md"); err == nil {
@@ -41,7 +41,7 @@ func render_readme_at_tree(tree *object.Tree) (readme_filename string, readme_co
return "Error fetching README", string_escape_html("Unable to render README: " + err.Error())
}
- return "README.md", template.HTML(bluemonday.UGCPolicy().SanitizeBytes(readme_rendered_unsafe.Bytes()))
+ return "README.md", template.HTML(bluemonday.UGCPolicy().SanitizeBytes(readme_rendered_unsafe.Bytes())) //#nosec G203
}
if readme_file, err = tree.File("README.org"); err == nil {
@@ -54,12 +54,12 @@ func render_readme_at_tree(tree *object.Tree) (readme_filename string, readme_co
return "Error fetching README", string_escape_html("Unable to render README: " + err.Error())
}
- return "README.org", template.HTML(bluemonday.UGCPolicy().Sanitize(org_html))
+ return "README.org", template.HTML(bluemonday.UGCPolicy().Sanitize(org_html)) //#nosec G203
}
return "", ""
}
func string_escape_html(s string) template.HTML {
- return template.HTML(html.EscapeString(s))
+ return template.HTML(html.EscapeString(s)) //#nosec G203
}