Skip to content

feat: read text:list content in odp slide text frames into ContentParagraph.list - #58

Merged
Mearman merged 2 commits into
mainfrom
feat/odp-list-levels
Aug 17, 2026
Merged

feat: read text:list content in odp slide text frames into ContentParagraph.list#58
Mearman merged 2 commits into
mainfrom
feat/odp-list-levels

Conversation

@Mearman

@Mearman Mearman commented Aug 17, 2026

Copy link
Copy Markdown
Member

The odp reader had no list handling at all: text:list content inside slide text frames (draw:frame > draw:text-box) was flattened by a deep text:p search, so nesting and membership information was lost. This reads it properly, mirroring the odt reader's own structural approach, per the odf.js item of ExaDev/document-schema.js#14.

  • draw:text-box content now walks its actual (text:p | text:list)* children instead of deep-searching for text:p. Paragraphs outside lists carry no list membership, in document order with the listed ones.
  • A text:list reads through the same machinery the odt reader uses: nesting depth comes off the actual text:list-in-text:list-item XML nesting, and numId is minted per top-level encounter from one document-wide counter threaded readOdp -> walkDrawShapes -> readDrawFrame -> readDrawFrameContent, with the ordered:/bullet: kind prefix resolved from the referenced text:list-style.
  • numId is minted rather than emitting the numId-less { level } shape that document-schema.js 3.3.0's optional numId makes possible. An ODP text box's lists carry genuine structural list identity -- a consumer grouping list paragraphs apart (separate
      /
        elements, per-list outline nesting) must be able to tell two sibling lists apart -- unlike pptx's a:pPr/@lvl, which is a bare depth attribute with no list element behind it. Emitting { level } alone here would discard a real, source-grounded fact. The criterion is documented in readDrawFrameContent's comment.
      1. The list walking (numId minting, kind resolution, item/nesting walk) is extracted from the odt reader into typed/shared/list.ts and reused rather than duplicated; odt behaviour is unchanged and its fixture tests still pass.
      2. Builds on document-schema.js ^3.3.0 (numId optional). The version bump itself landed on main via the sibling-released automation while this PR's CI ran, so this branch rebases on top of it rather than carrying its own bump commit.

    Tests: nested text:list yields incrementing levels under one numId; sibling lists in one text box and lists in separate frames get distinct identities; paragraphs outside lists carry no list; the kind prefix resolves from text:list-style and unstyled lists stay unprefixed.

    Generated by Claude Code

…/shared/list.ts

The odt reader's list machinery -- the per-encounter numId counter, the
ordered:/bullet: kind-prefix resolution, and the text:list/text:list-item
structural walk -- moves verbatim into a shared module so the odp reader can
reuse it against the identical text:list construct inside slide text boxes.
readOdfListParagraphs attaches list membership itself, so
readParagraphOrHeading loses its list parameter. No behaviour change.
…agraph.list

A draw:frame > draw:text-box carrying text:list content now reads through the
shared walker: nesting depth comes off the actual text:list-in-text:list-item
XML nesting, and numId is minted per top-level encounter from one
document-wide counter (threaded readOdp -> walkDrawShapes -> readDrawFrame ->
readDrawFrameContent), following the odt precedent. ODP text boxes carry
genuine structural list identity a consumer needs for grouping separate lists
apart, so the numId-less { level } shape schema 3.3.0 allows for level-only
sources (pptx's a:pPr/@lvl) would discard a real, source-grounded fact here.
The old deep text:p search is replaced by a direct-children walk over
draw:text-box's (text:p | text:list)* content model, preserving document
order.
@Mearman
Mearman force-pushed the feat/odp-list-levels branch from 10cf9c7 to ed6ac07 Compare August 17, 2026 21:42
@Mearman
Mearman merged commit 48c3ffa into main Aug 17, 2026
10 checks passed
@Mearman
Mearman deleted the feat/odp-list-levels branch August 17, 2026 21:44
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 3.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant