Skip to content

fix(docreader): preserve soft line breaks in PowerPoint table cells - #6150

Open
tumbledseea wants to merge 1 commit into
Tencent:mainfrom
tumbledseea:fix/pptx-table-soft-line-breaks
Open

tumbledseea wants to merge 1 commit into
Tencent:mainfrom
tumbledseea:fix/pptx-table-soft-line-breaks

Conversation

@tumbledseea

Copy link
Copy Markdown

Description

Pressing Shift+Enter in a PowerPoint table cell inserts a soft line break. When WeKnora imports the slide, python-pptx exposes that break as U+000B and the converter copies the control character into the Markdown table. A paragraph break in the same cell already produces <br />.

Normalize the PowerPoint soft break before escaping the cell. Both breaks now render inside the same table row. The regression test writes a real slide containing both kinds of break and checks the result through Parser.parse_file.

Type of Change

  • Bug fix
  • Regression test

Related work

Follow-up to #6019, which covered paragraph breaks and pipes. The distinction between paragraph and soft breaks is documented in the python-pptx cell API.

Testing

On upstream main at c378635, the new case failed with a literal U+000B between “line one” and “line two”. After the change the cell contains line one<br />line two<br />new paragraph.

python -m unittest docreader.tests.test_pptx_table_cells docreader.tests.test_pptx_media docreader.tests.test_ppt_convert docreader.tests.test_ppt_format_mismatch docreader.tests.test_csv_cell_boundaries

30 passed and 7 skipped. The skipped tests require optional PowerPoint fixtures or ImageMagick. Both table-cell tests passed. Validation was scoped to these conversion paths.

Checklist

  • git diff --check origin/main...HEAD passes
  • Tested the changed parser through its normal entry point
  • Reviewed the diff and updated regression coverage

This change was prepared and tested with OpenAI Codex.

Copilot AI balanced review requested due to automatic review settings November 27, 2026 15:35

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

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.

2 participants