You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
createTableOfContents parses a markdown string and returns a flat array of all h1–h6 headings in document order. The id of each entry is generated with the same slugify logic used by the seemark's markdown parser, so IDs are guaranteed to match the id prop on rendered heading components.
Options
Option Name
Type
Default Value
Description
enableLatex
boolean
true
When false, LaTeX expressions are not parsed as math.
enableAsciimath
boolean
true
When false, AsciiMath expressions are not parsed as math.
enableNemeth
boolean
true
When false, the Nemeth braille math extension is disabled and @…@ syntax is not parsed.
latexDelimiter
string
'bracket'
The delimiter for LaTeX expressions. Options: 'bracket', 'dollar'. Must match the renderer.
Return value
Each entry in the returned array has the following shape:
Field
Type
Description
level
number
Heading level (1–6)
id
string
URL-friendly slug, unique within the document
text
string
Plain heading text with inline markdown syntax stripped