Skip to content

fix(parser): preserve hyperlinks in document outputs - #5389

Open
xiejinwen113 wants to merge 1 commit into
opendatalab:masterfrom
xiejinwen113:codex/fix-document-hyperlinks
Open

xiejinwen113 wants to merge 1 commit into
opendatalab:masterfrom
xiejinwen113:codex/fix-document-hyperlinks

Conversation

@xiejinwen113

Copy link
Copy Markdown

Motivation

Hyperlinks were lost in several parsing paths: PPTX table cells were flattened with cell.text, DOCX table fallback conversion lost relationship context (and could drop an entire table containing OLE content), and PDF link annotations were never merged into middle JSON.

Modification

  • Preserve run-level hyperlinks while rendering PPTX table cells.
  • Restore DOCX table hyperlink relationships and add a native XML fallback for tables Mammoth cannot convert in isolation.
  • Read PDF URI and GoTo annotations, associate them with text spans, and emit internal page anchors.
  • Render hyperlink spans in pipeline/VLM Markdown and content-list-v2 outputs.
  • Add synthetic PPTX, DOCX, and PDF regression tests without external fixtures.

BC-breaking

No. Existing plain-text output remains unchanged when documents contain no link annotations.

Checklist

Before PR:

  • Bug fixes are fully covered by unit tests.
  • The modification is covered by unit tests.
  • git diff --check passes.

Test: uv run --with pytest pytest -o addopts='' -q tests/unittest/test_hyperlink_preservation.py (3 passed).

@dosubot dosubot Bot added the size:XL This PR changes 500-999 lines, ignoring generated files. label Aug 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant