Repository navigation
fix(jats): keep ext-link hyperlinks in fn-group footnotes - #5290
PeterStaar-IBM merged 1 commit into
Conversation
Article-level footnotes in fn-group dropped the xlink:href of an ext-link, so the link text lost its URL. Resolve ext-links there, as table footnotes and author notes already do. Signed-off-by: Shashank Yadav <[email protected]>
|
✅ DCO Check Passed Thanks @shashank11yadav, all your commits are properly signed off. 🎉 |
Merge Protections🟢 Merge protection satisfied — ready to merge. Show 1 satisfied protection🟢 Enforce conventional commitMake sure that we follow https://www.conventionalcommits.org/en/v1.0.0/
|
AI triage (advisory)Checked commit The PR passes Topic labels added: CI safety: no concern found. A maintainer must still approve CI. The |
There was a problem hiding this comment.
AI first review (advisory): no blocker found
This review covers the full diff at 5a1b924a10. It read the code and did not run it.
No blocking issue found. _add_footnote_group now passes resolve_ext_links=True, as the other footnote paths at lines 641 and 1430 already do. _walk_inline_formula passes the hyperlink down to nested runs, and _as_footnote_segments and _emit_inline keep it.
A maintainer makes the merge decision. This review never approves the pull request.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Issue resolved by this Pull Request:
Fixes #5289
Article-level footnotes in
fn-groupwere converted without resolvingext-linkelements. Thexlink:hrefwas dropped and only the link text was kept._add_footnote_groupis the one handler for everyfn-group(body and back matter), so the fix covers both. It now resolves ext-links in footnote text, the same way table footnotes and author notes already do. The change is one argument indocling/backend/xml/jats_backend.py.The new test
test_jats_footnote_group_keeps_external_link_targetputs thefn-groupin<back>. It checks that the link text becomes a footnote item with the hyperlink set, that the neighbouring runs have no hyperlink, and that the URL appears in the Markdown export. I did not add a separate body-level test.Checklist:
Review evidence:
Behavior before: a footnote in
fn-groupwith anext-linkkept the link text but no hyperlink.Behavior after: the link text is a footnote item whose hyperlink is the
xlink:hrefvalue.Commands run on commit 5a1b924, against
upstream/main:uv run --no-sync pytest tests/test_backend_jats.py: passuv run --no-sync pytest tests/test_backend_jats.py -k test_jats_footnote_group_keeps_external_link_target -v: passuv run --no-sync ruff check --config=pyproject.toml docling tests: passuv run --no-sync ruff format --check --config=pyproject.toml docling tests: passNot run: full
pytest tests,make validate,ty check,tach check,dprint check. No reference data was changed.