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.
This commit is contained in:
parent
cb52b17f92
commit
fb42972c05
14 changed files with 48 additions and 43 deletions
|
@ -105,7 +105,7 @@ func Projects(ctx *context.Context) {
|
|||
}
|
||||
|
||||
for _, project := range projects {
|
||||
project.RenderedContent = templates.Str2html(project.Description) // FIXME: is it right? why not render?
|
||||
project.RenderedContent = templates.SanitizeHTML(project.Description) // FIXME: is it right? why not render?
|
||||
}
|
||||
|
||||
err = shared_user.LoadHeaderCount(ctx)
|
||||
|
@ -396,7 +396,7 @@ func ViewProject(ctx *context.Context) {
|
|||
}
|
||||
}
|
||||
|
||||
project.RenderedContent = templates.Str2html(project.Description) // FIXME: is it right? why not render?
|
||||
project.RenderedContent = templates.SanitizeHTML(project.Description) // FIXME: is it right? why not render?
|
||||
ctx.Data["LinkedPRs"] = linkedPrsMap
|
||||
ctx.Data["PageIsViewProjects"] = true
|
||||
ctx.Data["CanWriteProjects"] = canWriteProjects(ctx)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue