Skip to content

fix: keep field text in PPTXToDocument with link extraction - #13388

Closed
L4XB wants to merge 1 commit into
deepset-ai:mainfrom
L4XB:fix/pptx-field-text
Closed

L4XB wants to merge 1 commit into
deepset-ai:mainfrom
L4XB:fix/pptx-field-text

Conversation

@L4XB

@L4XB L4XB commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

Related Issues

Proposed Changes:

With link_format="markdown" or "plain", PPTXToDocument._process_paragraph() joined paragraph.runs. python-pptx returns only the a:r children there. A field, such as a slide number or a date (a:fld), is a sibling of the runs, so its text was dropped. link_format="none" uses paragraph.text, which includes fields, so the formats gave different text:

link_format before after
none Slide 3 of the deck Slide 3 of the deck
markdown Slide of [the deck](https://example.com) Slide 3 of [the deck](https://example.com)
plain Slide of the deck (https://example.com) Slide 3 of the deck (https://example.com)

_process_paragraph() now walks the children of the paragraph element in order. An a:fld adds its text, and an a:r is formatted as before. Other children, including line breaks (a:br), are skipped as before, so this PR does not change line breaks.

How did you test it?

  • test_run_keeps_field_text_with_every_link_format builds a slide whose paragraph has Slide , a slide-number field, of and a hyperlinked run, and it is parametrized over the three link formats. The markdown and plain cases fail on main and pass here.
  • test/components/converters/test_pptx_to_document.py: 15 passed.
  • pre-commit run on the changed files passes (ruff check, ruff format, codespell, release-note backticks), and mypy on pptx.py passes.

Notes for the reviewer

As discussed in #13370, this PR covers only the field text. Line breaks are #13043, and #13222 changes the same loop to keep them. The two changes add separate branches to that loop, so whichever lands second needs a small rebase.

Checklist

  • I have read the contributors guidelines and the code of conduct.
  • I have updated the related issue with new insights and changes.
  • I have added unit tests and updated the docstrings.
  • I've used one of the conventional commit types for my PR title: fix:, feat:, build:, chore:, ci:, docs:, style:, refactor:, perf:, test: and added ! in case the PR includes breaking changes.
  • I have documented my code.
  • I have added a release note file, following the contributors guidelines.
  • I have run pre-commit hooks and fixed any issue.

@L4XB
L4XB requested a review from a team as a code owner October 22, 2026 09:25
@L4XB
L4XB requested review from sjrl and removed request for a team October 22, 2026 09:25
@vercel

vercel Bot commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

@L4XB is attempting to deploy a commit to the deepset Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions

Copy link
Copy Markdown
Contributor

Hi @L4XB, thanks for your interest in contributing to Haystack! 🙏

⚠️ Issue #13370 is already being addressed by open pull request(s) #13377. Before opening a PR for an issue, please check whether a PR is already linked to it, and consider contributing to the existing PR instead. We may close duplicate PRs to keep the review queue manageable.

This is an automated message to help us keep the review queue healthy.

@L4XB

L4XB commented Oct 22, 2026

Copy link
Copy Markdown
Contributor Author

Closing this as a duplicate of #13377, which fixes the same field text for #13370 and was opened first.

@L4XB L4XB closed this Oct 22, 2026
@L4XB
L4XB deleted the fix/pptx-field-text branch October 22, 2026 09:25
@github-actions

Copy link
Copy Markdown
Contributor

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  haystack/components/converters
  pptx.py
  haystack/core/pipeline
  pipeline.py
Project Total  

This report was generated by python-coverage-comment-action

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.

PPTXToDocument: line breaks become \v or are dropped, and field text is lost with link extraction

1 participant