Skip to content

fix: keep bare numbered levels as ordered markers - #184

Open
chriscoveries wants to merge 1 commit into
firecrawl:mainfrom
chriscoveries:fix/bare-numbered-lists
Open

chriscoveries wants to merge 1 commit into
firecrawl:mainfrom
chriscoveries:fix/bare-numbered-lists

Conversation

@chriscoveries

@chriscoveries chriscoveries commented Sep 30, 2026 •

Copy link
Copy Markdown

Summary

  • Treat a bare lvlText="%n" ordinal as reproducible by the list item's native Markdown marker.
  • Preserve restarted/complex numbering values while avoiding - 1 serialization for decimal, alphabetic, and roman ordered levels.
  • Add a generated minimal DOCX fixture covering 1, 2 -> interruption -> 9 through startOverride, plus a snapshot.
  • Update the existing ODT bare-number snapshot, which now emits ordered markers instead of bullet text.

Reproduction

Before this change, a DOCX level defined as numFmt="decimal" + lvlText="%1" rendered as:

- 1 First numbered paragraph.
- 2 Second numbered paragraph.

Heading break

- 9 Ninth numbered paragraph.

With this change it renders as:

1. First numbered paragraph.
2. Second numbered paragraph.

Heading break

9. Ninth numbered paragraph.

The distinction matters for legal/court exports that use Word auto-numbering with bare ordinals; the previous output preserved the values but encoded them as bullet text rather than Markdown ordered-list items.

Test plan

  • cargo fmt --check
  • cargo test -p anydoc
  • Verified the new fixture snapshot and the existing handmade-lists.odt snapshot.

Summary by cubic

Fixes rendering of DOCX/ODT list levels that use a bare ordinal pattern (lvlText="%1") so they emit Markdown ordered markers (1.) instead of bullet text (- 1). Restarted and non-decimal ordinals are preserved. Adds a DOCX fixture covering an interrupted restart and updates the ODT bare-number snapshot.

Written for commit 32dc831. Summary will update on new commits.

Review in cubic

Bare OOXML level patterns such as `%1` carry the item's ordinal but no
marker punctuation. Treating that rendered text as a composite label forced
Markdown output into `- 1`, losing ordered-list semantics even though GFM
can represent the list item itself.

Treat a bare ordinal pattern as reproducible by the native marker. This
keeps decimal and alphabetic/roman ordinals in ordered lists while still
using literal labels for composite patterns such as `%1-%2)`.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 5 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant