diff options
author | Zettat123 <zettat123@gmail.com> | 2023-02-24 14:36:07 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-24 14:36:07 +0800 |
commit | a6175b01d92a75dcbadbbfc6782a486636fd62a2 (patch) | |
tree | f2a285e28d559015bebf1f79e5acc23e03d47b52 /templates/package | |
parent | 045becf9aacb49554efbe353b47af0e64f2509c5 (diff) | |
download | gitea-a6175b01d92a75dcbadbbfc6782a486636fd62a2.tar.gz gitea-a6175b01d92a75dcbadbbfc6782a486636fd62a2.zip |
Fix nil context in RenderMarkdownToHtml (#23092)
Fix #23082.
This bug is caused by a nil context in
https://github.com/go-gitea/gitea/issues/23082#issuecomment-1441276546 .
---------
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Diffstat (limited to 'templates/package')
-rw-r--r-- | templates/package/content/cargo.tmpl | 2 | ||||
-rw-r--r-- | templates/package/content/chef.tmpl | 2 | ||||
-rw-r--r-- | templates/package/content/npm.tmpl | 2 | ||||
-rw-r--r-- | templates/package/content/pub.tmpl | 2 | ||||
-rw-r--r-- | templates/package/content/pypi.tmpl | 4 |
5 files changed, 6 insertions, 6 deletions
diff --git a/templates/package/content/cargo.tmpl b/templates/package/content/cargo.tmpl index f78647ca69..410a81d901 100644 --- a/templates/package/content/cargo.tmpl +++ b/templates/package/content/cargo.tmpl @@ -26,7 +26,7 @@ git-fetch-with-cli = true</code></pre></div> {{if or .PackageDescriptor.Metadata.Description .PackageDescriptor.Metadata.Readme}} <h4 class="ui top attached header">{{.locale.Tr "packages.about"}}</h4> {{if .PackageDescriptor.Metadata.Description}}<div class="ui attached segment">{{.PackageDescriptor.Metadata.Description}}</div>{{end}} - {{if .PackageDescriptor.Metadata.Readme}}<div class="ui attached segment">{{RenderMarkdownToHtml .PackageDescriptor.Metadata.Readme}}</div>{{end}} + {{if .PackageDescriptor.Metadata.Readme}}<div class="ui attached segment">{{RenderMarkdownToHtml $.Context .PackageDescriptor.Metadata.Readme}}</div>{{end}} {{end}} {{if .PackageDescriptor.Metadata.Dependencies}} diff --git a/templates/package/content/chef.tmpl b/templates/package/content/chef.tmpl index edc175f9be..d80ecdf403 100644 --- a/templates/package/content/chef.tmpl +++ b/templates/package/content/chef.tmpl @@ -20,7 +20,7 @@ <h4 class="ui top attached header">{{.locale.Tr "packages.about"}}</h4> <div class="ui attached segment"> {{if .PackageDescriptor.Metadata.Description}}<p>{{.PackageDescriptor.Metadata.Description}}</p>{{end}} - {{if .PackageDescriptor.Metadata.LongDescription}}{{RenderMarkdownToHtml .PackageDescriptor.Metadata.LongDescription}}{{end}} + {{if .PackageDescriptor.Metadata.LongDescription}}{{RenderMarkdownToHtml $.Context .PackageDescriptor.Metadata.LongDescription}}{{end}} </div> {{end}} diff --git a/templates/package/content/npm.tmpl b/templates/package/content/npm.tmpl index ea514c5263..d0c037b38a 100644 --- a/templates/package/content/npm.tmpl +++ b/templates/package/content/npm.tmpl @@ -25,7 +25,7 @@ <div class="ui attached segment"> {{if .PackageDescriptor.Metadata.Readme}} <div class="markup markdown"> - {{RenderMarkdownToHtml .PackageDescriptor.Metadata.Readme}} + {{RenderMarkdownToHtml $.Context .PackageDescriptor.Metadata.Readme}} </div> {{else if .PackageDescriptor.Metadata.Description}} {{.PackageDescriptor.Metadata.Description}} diff --git a/templates/package/content/pub.tmpl b/templates/package/content/pub.tmpl index e81439d4da..d5676fca5a 100644 --- a/templates/package/content/pub.tmpl +++ b/templates/package/content/pub.tmpl @@ -14,6 +14,6 @@ {{if or .PackageDescriptor.Metadata.Description .PackageDescriptor.Metadata.Readme}} <h4 class="ui top attached header">{{.locale.Tr "packages.about"}}</h4> {{if .PackageDescriptor.Metadata.Description}}<div class="ui attached segment">{{.PackageDescriptor.Metadata.Description}}</div>{{end}} - {{if .PackageDescriptor.Metadata.Readme}}<div class="ui attached segment">{{RenderMarkdownToHtml .PackageDescriptor.Metadata.Readme}}</div>{{end}} + {{if .PackageDescriptor.Metadata.Readme}}<div class="ui attached segment">{{RenderMarkdownToHtml $.Context .PackageDescriptor.Metadata.Readme}}</div>{{end}} {{end}} {{end}} diff --git a/templates/package/content/pypi.tmpl b/templates/package/content/pypi.tmpl index 830ba9bd67..8dbed5395e 100644 --- a/templates/package/content/pypi.tmpl +++ b/templates/package/content/pypi.tmpl @@ -16,9 +16,9 @@ <div class="ui attached segment"> <p>{{if .PackageDescriptor.Metadata.Summary}}{{.PackageDescriptor.Metadata.Summary}}{{end}}</p> {{if .PackageDescriptor.Metadata.LongDescription}} - {{RenderMarkdownToHtml .PackageDescriptor.Metadata.LongDescription}} + {{RenderMarkdownToHtml $.Context .PackageDescriptor.Metadata.LongDescription}} {{else if .PackageDescriptor.Metadata.Description}} - {{RenderMarkdownToHtml .PackageDescriptor.Metadata.Description}} + {{RenderMarkdownToHtml $.Context .PackageDescriptor.Metadata.Description}} {{end}} </div> {{end}} |