summaryrefslogtreecommitdiffstats
path: root/modules/markup
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2021-07-12 23:13:59 +0200
committerGitHub <noreply@github.com>2021-07-12 17:13:59 -0400
commit46a4c6835daf4642074bb1a18a3210b03a64259b (patch)
treea9a069d550e2c32904d691f3f89589aac814b1f6 /modules/markup
parentfb04cc7dbd619589e45180e1a017c8039ecd9342 (diff)
downloadgitea-46a4c6835daf4642074bb1a18a3210b03a64259b.tar.gz
gitea-46a4c6835daf4642074bb1a18a3210b03a64259b.zip
Fix external renderer (#16401)
* fix external renderer * use GBackground context as fallback * no fallback, return error Co-authored-by: Lauris BH <lauris@nix.lv>
Diffstat (limited to 'modules/markup')
-rw-r--r--modules/markup/external/external.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/modules/markup/external/external.go b/modules/markup/external/external.go
index e35a1b99c0..52139f5a49 100644
--- a/modules/markup/external/external.go
+++ b/modules/markup/external/external.go
@@ -98,6 +98,10 @@ func (p *Renderer) Render(ctx *markup.RenderContext, input io.Reader, output io.
args = append(args, f.Name())
}
+ if ctx == nil || ctx.Ctx == nil {
+ return fmt.Errorf("RenderContext did not provide context")
+ }
+
processCtx, cancel := context.WithCancel(ctx.Ctx)
defer cancel()