diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2024-03-01 18:16:19 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-01 10:16:19 +0000 |
commit | fb42972c057364a1dc99dfb528554e7a94415be7 (patch) | |
tree | 162d9e043c62df788f438ae2bb65983e301f8517 /routers/web/repo/issue.go | |
parent | cb52b17f92e2d2293f7c003649743464492bca48 (diff) | |
download | gitea-fb42972c057364a1dc99dfb528554e7a94415be7.tar.gz gitea-fb42972c057364a1dc99dfb528554e7a94415be7.zip |
Rename Str2html to SanitizeHTML and clarify its behavior (#29516)
Str2html was abused a lot. So use a proper name for it: SanitizeHTML
And add some tests to show its behavior.
Diffstat (limited to 'routers/web/repo/issue.go')
-rw-r--r-- | routers/web/repo/issue.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/routers/web/repo/issue.go b/routers/web/repo/issue.go index 702aa7201b..ebaa955ac8 100644 --- a/routers/web/repo/issue.go +++ b/routers/web/repo/issue.go @@ -1761,7 +1761,7 @@ func ViewIssue(ctx *context.Context) { // so "|" is used as delimeter to mark the new format if comment.Content[0] != '|' { // handle old time comments that have formatted text stored - comment.RenderedContent = templates.Str2html(comment.Content) + comment.RenderedContent = templates.SanitizeHTML(comment.Content) comment.Content = "" } else { // else it's just a duration in seconds to pass on to the frontend |