helpers: Fix TrimShortHTML when used with AsciiDoc content

Fixes #12369
This commit is contained in:
Joe Mooring
2024-04-13 21:17:39 -07:00
committed by Bjørn Erik Pedersen
parent 8e50ccfae7
commit 6049ba99f0
5 changed files with 40 additions and 33 deletions

View File

@@ -363,9 +363,11 @@ func (pco *pageContentOutput) RenderString(ctx context.Context, args ...any) (te
}
if opts.Display == "inline" {
// We may have to rethink this in the future when we get other
// renderers.
rendered = pco.po.p.s.ContentSpec.TrimShortHTML(rendered)
markup := pco.po.p.m.pageConfig.Markup
if opts.Markup != "" {
markup = pco.po.p.s.ContentSpec.ResolveMarkup(opts.Markup)
}
rendered = pco.po.p.s.ContentSpec.TrimShortHTML(rendered, markup)
}
return template.HTML(string(rendered)), nil