aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorZettat1232023-02-24 14:36:07 +0800
committerGitHub2023-02-24 14:36:07 +0800
commita6175b01d92a75dcbadbbfc6782a486636fd62a2 (patch)
treef2a285e28d559015bebf1f79e5acc23e03d47b52 /modules
parent045becf9aacb49554efbe353b47af0e64f2509c5 (diff)
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 'modules')
-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 4ffd0a5de..b7bd07670 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 {