diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2024-03-01 08:11:51 +0100 |
---|---|---|
committer | Earl Warren <contact@earl-warren.org> | 2024-03-06 05:10:44 +0100 |
commit | 68099f2f008adf53c5f79dad82e930486fb80c03 (patch) | |
tree | 5d9ac530439b5f7e3c3ed6660568152e9a78a2c3 /templates/repo/release/list.tmpl | |
parent | [skip ci] Updated translations via Crowdin (diff) | |
download | forgejo-68099f2f008adf53c5f79dad82e930486fb80c03.tar.xz forgejo-68099f2f008adf53c5f79dad82e930486fb80c03.zip |
Refactor some Str2html code (#29397)
This PR touches the most interesting part of the "template refactoring".
1. Unclear variable type. Especially for "web/feed/convert.go":
sometimes it uses text, sometimes it uses HTML.
2. Assign text content to "RenderedContent" field, for example: `
project.RenderedContent = project.Description` in web/org/projects.go
3. Assign rendered content to text field, for example: `r.Note =
rendered content` in web/repo/release.go
4. (possible) Incorrectly calling `{{Str2html
.PackageDescriptor.Metadata.ReleaseNotes}}` in
package/content/nuget.tmpl, I guess the name Str2html misleads
developers to use it to "render string to html", but it only sanitizes.
if ReleaseNotes really contains HTML, then this is not a problem.
(cherry picked from commit e71eb8930a5d0f60874b038c223498b41ad65592)
Conflicts:
modules/templates/util_string.go
trivial context conflict
Diffstat (limited to 'templates/repo/release/list.tmpl')
-rw-r--r-- | templates/repo/release/list.tmpl | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/templates/repo/release/list.tmpl b/templates/repo/release/list.tmpl index d533cf6757..c26a58f23a 100644 --- a/templates/repo/release/list.tmpl +++ b/templates/repo/release/list.tmpl @@ -58,7 +58,7 @@ {{end}} </p> <div class="markup desc"> - {{Str2html $release.Note}} + {{$release.RenderedNote}} </div> <div class="divider"></div> <details class="download" {{if eq $idx 0}}open{{end}}> |