You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(pdf): render PDF hyperlink annotations as Markdown links in strict mode
The standard docling PDF pipeline discards link annotations, so emitting
them would break byte-for-byte conformance. This adds them to the Rust-only
`strict(true)` output only — legacy/docling output (and the 4/14 groundtruth
conformance + 91/91 snapshot baseline) is left untouched.
- pdfium_backend: extract per-page link annotations (rect + URI), restricted
to web/mailto/tel schemes, into `PdfPage.links`.
- assemble: resolve each link rect to the visible anchor text via per-word
cells (line-merged cells would over-capture a whole line), cleaned the same
way prose is; accumulate `(anchor, href)` onto the document in reading order.
- core: `DoclingDocument.links` + a strict-only serializer pass that wraps each
anchor as `[anchor](href)`, matching the body's HTML-escaped form and
consuming repeated anchors in document order.
Verified on a real CV PDF: LinkedIn/GitHub/email/cert links render in strict
mode; default output has none.
Note: this does not change PDF conformance (still 4/14). The remaining
near-misses (RTL justified-space reconstruction, two-column figure-overflow
reading order, TableFormer multi-row headers, layout misclassification) are
model-level and not safe quick fixes; documented in PDF_CONFORMANCE.md.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012RkJ8nFxQQB2Qn3sTgg8hT
0 commit comments