Skip to content

Populate headingLevel on read; switch the write-side clamp to the shared helper #54

Description

@Mearman

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions