Skip to content

VaultMD / Heading

Type Alias: Heading

Heading = object

Defined in: src/headings/models/heading.ts:5

One ATX heading and the span of the section it opens, as returned by extractHeadings. All offsets index the string that was scanned.

Properties

bodyStart

bodyStart: number

Defined in: src/headings/models/heading.ts:16

Offset of the section body's first character — the start of the first NON-blank line after the heading line. Equals end for an empty section.


end

end: number

Defined in: src/headings/models/heading.ts:22

Offset one past the section body — one past the last non-blank line, including its newline when it has one. Blank lines before the next heading fall outside, so replacing [bodyStart, end) preserves the file's spacing.


level

level: number

Defined in: src/headings/models/heading.ts:9

ATX depth, 1 to 6.


start

start: number

Defined in: src/headings/models/heading.ts:11

Offset of the start of the heading line, before any 0–3 spaces of indent.


text

text: string

Defined in: src/headings/models/heading.ts:7

Heading text, trimmed, with any closing ## sequence stripped.

Released under the MIT License.