Skip to content

Preserve soft line breaks in doc2md PPTX text - #18457

Open
LimbC-C wants to merge 1 commit into
PaddlePaddle:mainfrom
LimbC-C:fix/doc2md-pptx-soft-line-breaks
Open

LimbC-C wants to merge 1 commit into
PaddlePaddle:mainfrom
LimbC-C:fix/doc2md-pptx-soft-line-breaks

Conversation

@LimbC-C

@LimbC-C LimbC-C commented Nov 17, 2026

Copy link
Copy Markdown

Fixes #18456.

PowerPoint stores a manual break within a paragraph as a separate DrawingML a:br element. The text-box converter previously read paragraph.runs, so it concatenated the text on either side of the break.

Read the runs and soft breaks in XML order and render each explicit break as inline <br> within the same Markdown list item. This keeps consecutive breaks, neighboring formatting and links, and separate paragraphs. The regression also checks that a paragraph consisting only of a break still produces no bullet.

Validation

  • A real generated PPTX fails on the original source and passes after the fix with python-pptx 1.0.2 and the supported minimum 0.6.21.
  • python -m paddleocr doc2md preserves both breaks when converting the original failing fixture.
  • The configured hooks for both changed files, including Black and Flake8, passed. OCR, model and full-repository tests were outside this local run.

AI-assisted implementation and testing with Codex.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[third-party] doc2md drops soft line breaks in PowerPoint text boxes

1 participant