Companion to ExaDev/document-schema.js#13, which proposes a canonical headingLevel?: number field on ContentParagraph, and promoting this package's own private styleId-to-level parser (currently only used by the writer, test md/heading-level-clamped) into a shared, exported helper there.
Two changes here once #13 lands:
- Reader: populate
headingLevel directly from #-depth on read — trivial, CommonMark headings are already numbered 1-6 by construction, no inference needed the way docx/odt need.
- Writer: switch the existing private clamp-to-6 logic over to the promoted shared helper instead of keeping its own copy, so there's one heading-level parser in the ecosystem instead of two.
Blocked by ExaDev/document-schema.js#13 landing the field and the shared helper first.
Companion to ExaDev/document-schema.js#13, which proposes a canonical
headingLevel?: numberfield onContentParagraph, and promoting this package's own private styleId-to-level parser (currently only used by the writer, testmd/heading-level-clamped) into a shared, exported helper there.Two changes here once #13 lands:
headingLeveldirectly from#-depth on read — trivial, CommonMark headings are already numbered 1-6 by construction, no inference needed the way docx/odt need.Blocked by ExaDev/document-schema.js#13 landing the field and the shared helper first.