summaryrefslogtreecommitdiffstats
path: root/modules/templates
diff options
context:
space:
mode:
authorYarden Shoham <hrsi88@gmail.com>2023-02-24 15:17:03 +0200
committerGitHub <noreply@github.com>2023-02-24 21:17:03 +0800
commite02e752f688d8822d0da6e824f303f3819195eb9 (patch)
tree0fefc28e6292d075e0cd6d0039cdf26abdb3fbf1 /modules/templates
parent5ddf67a9c2325282a2121672d7d7ea77789e2cf8 (diff)
downloadgitea-e02e752f688d8822d0da6e824f303f3819195eb9.tar.gz
gitea-e02e752f688d8822d0da6e824f303f3819195eb9.zip
Fix nil context in RenderMarkdownToHtml (#23092) (#23108)
Backport #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: Zettat123 <zettat123@gmail.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Diffstat (limited to 'modules/templates')
-rw-r--r--modules/templates/helper.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/templates/helper.go b/modules/templates/helper.go
index 4ffd0a5dee..b7bd07670c 100644
--- a/modules/templates/helper.go
+++ b/modules/templates/helper.go
@@ -174,8 +174,9 @@ func NewFuncMap() []template.FuncMap {
"RenderEmojiPlain": emoji.ReplaceAliases,
"ReactionToEmoji": ReactionToEmoji,
"RenderNote": RenderNote,
- "RenderMarkdownToHtml": func(input string) template.HTML {
+ "RenderMarkdownToHtml": func(ctx context.Context, input string) template.HTML {
output, err := markdown.RenderString(&markup.RenderContext{
+ Ctx: ctx,
URLPrefix: setting.AppSubURL,
}, input)
if err != nil {