Repository navigation
fix(pptx): read a line break as a newline instead of a vertical tab - #4571
Merged
Merged
Conversation
cragwolfe
approved these changes
Oct 21, 2026
cragwolfe
left a comment
Contributor
There was a problem hiding this comment.
Reviewed 7c8087d34b0d4f31207f8fc2b60934276fcb1951 with GPT Pro. No actionable production defects found. Line-break normalization is consistent across titles, body paragraphs and notes; the regression test covers serialized PPTX input and exact text ordering.
This is a code-review approval. Required test/lint CI is not verified: the Actions runs require approval, and the two successful Socket checks do not establish test success. No tests were run locally.
(authored by codex)
Merged
linhongyu510
pushed a commit
to linhongyu510/unstructured
that referenced
this pull request
Oct 22, 2026
Drops the `-dev6` suffix so 0.27.34 can be tagged and published. There are no code changes. Since 0.27.33, this release contains: - Free decode buffers sooner when restoring original elements (Unstructured-IO#4524) - Free image buffers sooner during figure extraction (Unstructured-IO#4523) - Honor `encoding=` in `partition_json` and `partition_ndjson` (Unstructured-IO#4483) - Read a PowerPoint line break as a newline (Unstructured-IO#4571) - Drop the empty entry of an email address group (Unstructured-IO#4576) - Read CSV and TSV cells as the file holds them (Unstructured-IO#4574) - Classify text as an email address only when all of it is one (Unstructured-IO#4577) After merge, create the `0.27.34` GitHub release from the merge commit. That publishes to PyPI. <!-- This is an auto-generated description by cubic. --> <a href="https://cubic.dev/pr/Unstructured-IO/unstructured/pull/4582?utm_source=github" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img alt="View guided diff" src="https://www.cubic.dev/buttons/review-in-cubic-light.svg"></picture></a> <!-- End of auto-generated description by cubic. -->
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
python-pptx returns a line break inside a paragraph (Shift+Enter in PowerPoint,
<a:br/>in the XML) as a vertical tab (\v).partition_pptx()passesparagraph.textthrough unchanged, so that control character ends up in the element text of titles, text boxes and slide notes:mainQuarterly⏎results'Quarterly\x0bresults''Quarterly\nresults'First line⏎second line'First line\x0bsecond line''First line\nsecond line'Note one⏎note two'Note one\x0bnote two''Note one\nnote two'Table cells were already unaffected, because their text goes through the HTML table normalization.
Change
A small
_break_lines()helper replaces\vwith\n. It is used for paragraph text in_iter_shape_elements()and_iter_title_shape_element(), and for the slide-notes text. A newline is how the DOCX partitioner already gives aw:brline break, since python-docx reads it as\n.Testing
test_partition_pptx_reads_line_breaks_as_newlinesbuilds a slide with a line break in the title, in a text box and in the notes. It fails onmain.test_pptx.pypass. The.ppttests need LibreOffice, which isn't installed here.scripts/version-sync.sh -cpasses with0.27.34-dev1.