Fix RenderString for pages without content

Fixes #6882
This commit is contained in:
Bjørn Erik Pedersen 2020-02-18 14:00:58 +01:00
parent 20f2211fce
commit 19e12caf8c
No known key found for this signature in database
GPG key ID: 330E6E2BD4859D8F
4 changed files with 62 additions and 13 deletions

View file

@ -631,6 +631,20 @@ func (p *pageState) wrapError(err error) error {
}
func (p *pageState) getContentConverter() converter.Converter {
var err error
p.m.contentConverterInit.Do(func() {
markup := p.m.markup
if markup == "html" {
// Only used for shortcode inner content.
markup = "markdown"
}
p.m.contentConverter, err = p.m.newContentConverter(p, markup, p.m.renderingConfigOverrides)
})
if err != nil {
p.s.Log.ERROR.Println("Failed to create content converter:", err)
}
return p.m.contentConverter
}