Skip to content

FIX: keep line breaks in image text converters - #3474

Merged
Richard Lundeen (richlundeen) merged 3 commits into
microsoft:mainfrom
u7k4rs6:fix/image-text-newlines
Oct 25, 2026
Merged

Richard Lundeen (richlundeen) merged 3 commits into
microsoft:mainfrom
u7k4rs6:fix/image-text-newlines

Conversation

@u7k4rs6

Copy link
Copy Markdown
Contributor

The image text converters wrapped text with textwrap.fill, which turns newlines into spaces, so multi-line text got drawn as one paragraph. This wraps each line separately, so line breaks and blank lines show up in the image and long lines still wrap. The new tests go through convert_async for all three converters and fail on main.

Fixes #3473

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good. Wrapping each input line separately preserves intentional line breaks and empty lines, while retaining word wrapping for long lines.

Reviewed with GitHub Copilot.

@richlundeen
Richard Lundeen (richlundeen) added this pull request to the merge queue Oct 25, 2026
Merged via the queue into microsoft:main with commit 3feeca4 Oct 25, 2026
65 checks passed
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.

BUG: image text converters drop line breaks

2 participants