Markdown.EnumerateHeadings Method
- Namespace
- Kampute.DocToolkit.Support
- Assembly
- Kampute.DocToolkit.dll
Definition
Enumerates all ATX-style headings in the given Markdown content, returning their text and corresponding levels.
public static IEnumerable<ValueTuple<int, string>> EnumerateHeadings(string content)Parameters
contentstring- The Markdown content to inspect.
Returns
- IEnumerable<ValueTuple<int, string>>
- An enumerable of tuples, each containing the level and text of a heading found in the content.
Exceptions
- ArgumentNullException
- Thrown when
contentisnull.

#Titleis a heading. An optional closing sequence of '#' characters, when preceded by whitespace, is not part of the heading text, and backslash escapes in the heading text are decoded. Lines inside fenced code blocks are not headings.