Skip to content

fix(serializer): keep only ASCII-digit list markers as Markdown markers - #1099

Open
asadsehto wants to merge 1 commit into
docling-project:mainfrom
asadsehto:fix/md-ascii-digit-list-marker
Open

asadsehto wants to merge 1 commit into
docling-project:mainfrom
asadsehto:fix/md-ascii-digit-list-marker

Conversation

@asadsehto

Copy link
Copy Markdown

Markdown export kept a list item's original marker whenever it matched \d+\.. Python's \d matches any Unicode decimal digit, so markers such as १. (Devanagari) and 1. (full-width) were written without a -, and CommonMark, which only accepts ASCII digits in an ordered-list marker, rendered the items as one paragraph. The check now uses [0-9]+\., so these markers get a - like any other non-standard marker, and ASCII markers such as 3. are unchanged.

Issue resolved by this Pull Request:
Resolves #1098

Checklist:

  • Documentation has been updated, if necessary.
  • Examples have been added, if necessary.
  • Tests have been added, if necessary.

Review evidence:

  • Before: the reproducer in Markdown export: list markers with non-ASCII digits (१., 1.) are kept as-is and break the list #1098 gives १. a / २. b, which MarkdownIt("commonmark") renders as <p>१. a\n२. b</p>. After: - १. a / - २. b, rendered as a <ul> list.
  • test_md_list_item_marker_auto_non_ascii gets three cases: 3. (unchanged), १. and 3.. The two non-ASCII cases fail on main; all 9 cases pass with this change.
  • pytest tests (Python 3.12, macOS): 1905 passed, 12 skipped, 53 xfailed (main: 1902 passed; the difference is the three new cases). No reference files changed.
  • make validate: passed (ruff 0.16.10, ty, docs, whitespace hooks).

Reported in the review of docling-project/docling#5657, which adds hindiNumbers markers; docling's decimalFullWidth markers (docling-project/docling#4336) were already affected.

Signed-off-by: asad saleem <156583018+asadsehto@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

✅ DCO Check Passed

Thanks @asadsehto, all your commits are properly signed off. 🎉

@mergify

mergify Bot commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

Merge Protections

🔴 1 of 2 protections blocking · waiting on 👀 reviews

Protection Waiting on
🔴 Require two reviewer for test updates 👀 reviews
🟢 Enforce conventional commit —

🔴 Require two reviewer for test updates

Waiting for

  • #approved-reviews-by >= 2
This rule is failing.

When test data is updated, we require two reviewers

  • #approved-reviews-by >= 2

Show 1 satisfied protection

🟢 Enforce conventional commit

Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/

  • title ~= ^(fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert)(?:\(.+\))?(!)?:

@github-actions github-actions Bot added bug Something isn't working serialization Output serializers: Markdown, HTML, LaTeX, JSON, plain-text, outline labels Nov 28, 2026
@github-actions

Copy link
Copy Markdown
Contributor

AI triage (advisory)

Checked commit 82309dad19. The analysis read the diff only. It did not run code from this pull request.

Warning

The AI analysis did not finish. Only the deterministic checks are shown.

Topic labels added: bug, serialization.

CI safety: not assessed.

The ai:* labels are advisory. They do not approve CI and they do not add tests:full. A new push runs this check again.

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

bug Something isn't working serialization Output serializers: Markdown, HTML, LaTeX, JSON, plain-text, outline

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Markdown export: list markers with non-ASCII digits (१., 1.) are kept as-is and break the list

1 participant