resolveHeadingTitle #

The plain-text title of a heading: the text its author wrote on the heading line, without the Markdown formatting markup and without HTML tags.

Usage #

Parameters

inlineToken

The inline token of the heading.

Returns The plain text of the heading.

Notes #

Formatting markup and HTML tags disappear while the text between them stays, so <kbd>Ctrl</kbd> reads Ctrl and <Badge text="beta" /> reads nothing. Inline code keeps its content without the backticks, and any other syntax keeps the markup it was written with, so inline math stays $E=mc^2$ and an emoji shortcode stays :smile:. A token type this function has never seen keeps its content too, so a Markdown plugin can never make heading text disappear, and the title of a page never depends on which plugins a site installed.

Full type signature
TypeScript
function resolveHeadingTitle(inline: Token): string

Edit this page

Comments