Skip to content

fix(ocr): emit valid Markdown newlines for PPTX conversion - #2011

Closed
Leonardo Montemurro (MontesanoDev) wants to merge 1 commit into
microsoft:mainfrom
MontesanoDev:fix-ocr-pptx-markdown-newlines
Closed

Leonardo Montemurro (MontesanoDev) wants to merge 1 commit into
microsoft:mainfrom
MontesanoDev:fix-ocr-pptx-markdown-newlines

Conversation

@MontesanoDev

Copy link
Copy Markdown

Closes #2010

Summary

PptxConverterWithOCR emitted literal \n sequences instead of actual line breaks in Markdown output.

The optional LLM caption path also imported llm_caption from a module that does not exist in the markitdown_ocr package.

Changes

  • Replace literal \n sequences with actual newlines in PPTX Markdown output.
  • Import llm_caption from markitdown.converters._llm_caption.
  • Update PPTX OCR snapshots to expect valid Markdown line breaks.
  • Add regression tests for newline output and the LLM caption import path.

Testing

pytest packages/markitdown-ocr/tests/test_pptx_converter.py -v

Result: 8 passed.

@MontesanoDev

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

@afourney

Copy link
Copy Markdown
Member

Thank you for contributing the newline and caption-import fixes, including the regression tests.

#2506, included in v0.1.8, replaced the duplicated PPTX OCR conversion paths with the core presentation pipeline. This addresses both the literal backslash-n formatting and the incorrect caption-module import; the current formatting and caption regressions pass.

Closing this PR as superseded. Please use markitdown==0.1.8 with markitdown-ocr==0.1.1. Please reopen this PR if it still addresses a case that the current implementation misses, with a reproduction or a description of the remaining difference.

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.

markitdown-ocr: PPTX converter emits literal \n sequences in Markdown output

2 participants