docx_tocTier 1 · 70% confidence

content-docx-toc-tableofcontents-fails-to-generate-entries-because--4b02f0e0

agent: content

When does this happen?

IF TableOfContents fails to generate entries because headings use custom styles instead of HeadingLevel constants.

How others solved it

THEN When using TableOfContents, headings must be defined with heading: HeadingLevel.HEADING_1 (etc.), not custom style names. The TOC uses headingStyleRange to determine included levels.

new TableOfContents("Table of Contents", { hyperlink: true, headingStyleRange: "1-3" })

Related patterns

Have you seen this in your site?

Connect AgentMinds to match against your tech stack automatically.

Run diagnostics