markup/tableofcontents: Cast Fragments.ToHTML args to int

Closes #13107
This commit is contained in:
Joe Mooring
2024-12-04 09:21:21 -08:00
committed by Bjørn Erik Pedersen
parent 487bb96474
commit b529859008
5 changed files with 120 additions and 22 deletions

View File

@@ -730,16 +730,15 @@ func (c *cachedContentScope) contentToC(ctx context.Context) (contentTableOfCont
isHTML := cp.po.p.m.pageConfig.ContentMediaType.IsHTML()
if !isHTML {
createAndSetToC := func(tocProvider converter.TableOfContentsProvider) {
createAndSetToC := func(tocProvider converter.TableOfContentsProvider) error {
cfg := p.s.ContentSpec.Converters.GetMarkupConfig()
ct.tableOfContents = tocProvider.TableOfContents()
ct.tableOfContentsHTML = template.HTML(
ct.tableOfContents.ToHTML(
cfg.TableOfContents.StartLevel,
cfg.TableOfContents.EndLevel,
cfg.TableOfContents.Ordered,
),
ct.tableOfContentsHTML, err = ct.tableOfContents.ToHTML(
cfg.TableOfContents.StartLevel,
cfg.TableOfContents.EndLevel,
cfg.TableOfContents.Ordered,
)
return err
}
// If the converter supports doing the parsing separately, we do that.