import type { HeadingItem } from './types.js'; /** * Extracts H1-H6 headings from HTML in document order. * * Heading text is converted to plain text, nested tags are removed, * common entities are decoded, and empty headings are skipped. * * @param html - HTML markup to parse. * @returns Ordered heading items with level and text. * * @example * extractHeadings('