aboutsummaryrefslogtreecommitdiffhomepage
path: root/hugolib/page.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2022-10-26 10:09:38 +0200
committerBjørn Erik Pedersen <[email protected]>2022-10-26 13:00:21 +0200
commit631d768be9dc2d5175eeacb8bf34ed8233e2201a (patch)
tree670dbabab18d4215f2495dd07fe012ed4e223438 /hugolib/page.go
parente5d2a8f6a3121701eb95712b5540989fafaa0c71 (diff)
downloadhugo-631d768be9dc2d5175eeacb8bf34ed8233e2201a.tar.gz
hugo-631d768be9dc2d5175eeacb8bf34ed8233e2201a.zip
Revise the fix for shortcode vs output format nilpointer
We do lazy initialization and (potentially) reuse of an output format's rendered content. We do this evaluation when we start a new rendering a new output format. There are, however, situation where these borders gets crossed (e.g. accessing content from another output format). We have a check for this in place for most cases, but not the content rendering of inner markdown blocks inside shortcodes. This patch applies that same logic to the newly introduced RenderContent method (which is not available from the templates). Fixes #10391
Diffstat (limited to 'hugolib/page.go')
-rw-r--r--hugolib/page.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/hugolib/page.go b/hugolib/page.go
index 37bf528c7..9f0d08ca3 100644
--- a/hugolib/page.go
+++ b/hugolib/page.go
@@ -909,6 +909,7 @@ func (p *pageState) shiftToOutputFormat(isRenderingSite bool, idx int) error {
}
return cp, nil
})
+ p.pageOutput.contentRenderer = lcp
p.pageOutput.ContentProvider = lcp
p.pageOutput.TableOfContentsProvider = lcp
p.pageOutput.PageRenderProvider = lcp