Skip to content

fix(jats): keep ext-link hyperlinks in fn-group footnotes - #5290

Merged
PeterStaar-IBM merged 1 commit into
docling-project:mainfrom
shashank11yadav:fix/jats-fn-group-ext-link
Nov 11, 2026
Merged

PeterStaar-IBM merged 1 commit into
docling-project:mainfrom
shashank11yadav:fix/jats-fn-group-ext-link

Conversation

@shashank11yadav

Copy link
Copy Markdown
Contributor

Issue resolved by this Pull Request:
Fixes #5289

Article-level footnotes in fn-group were converted without resolving ext-link elements. The xlink:href was dropped and only the link text was kept. _add_footnote_group is the one handler for every fn-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 in docling/backend/xml/jats_backend.py.

The new test test_jats_footnote_group_keeps_external_link_target puts the fn-group in <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:

  • Documentation has been updated, if necessary.
  • Examples have been added, if necessary.
  • Tests have been added, if necessary.

Review evidence:

Behavior before: a footnote in fn-group with an ext-link kept the link text but no hyperlink.
Behavior after: the link text is a footnote item whose hyperlink is the xlink:href value.

Commands run on commit 5a1b924, against upstream/main:

  • uv run --no-sync pytest tests/test_backend_jats.py: pass
  • uv run --no-sync pytest tests/test_backend_jats.py -k test_jats_footnote_group_keeps_external_link_target -v: pass
  • The new test fails without the fix (exit 1).
  • uv run --no-sync ruff check --config=pyproject.toml docling tests: pass
  • uv run --no-sync ruff format --check --config=pyproject.toml docling tests: pass

Not run: full pytest tests, make validate, ty check, tach check, dprint check. No reference data was changed.

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]>
@github-actions

Copy link
Copy Markdown
Contributor

✅ DCO Check Passed

Thanks @shashank11yadav, all your commits are properly signed off. 🎉

@mergify

mergify Bot commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

Merge Protections

🟢 Merge protection satisfied — ready to merge.

Show 1 satisfied protection

🟢 Enforce conventional commit

Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/

  • title ~= ^(fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert)(?:\(.+\))?(!)?:

@github-actions github-actions Bot added ai:ci-safe AI triage found no CI-safety concern (advisory) bug Something isn't working jats issue related to JATS XML backend xml issue related to supported schema-specific XML formats labels Nov 10, 2026
@github-actions

Copy link
Copy Markdown
Contributor

AI triage (advisory)

Checked commit 5a1b924a10. The analysis read the diff only. It did not run code from this pull request.

The PR passes resolve_ext_links=True when _add_footnote_group walks fn-group footnotes in the JATS backend. ext-link hyperlinks in these footnotes are now kept. It adds a test for this.

Topic labels added: bug, jats, xml.

CI safety: no concern found. A maintainer must still approve CI.

The ai:* labels are advisory. They do not approve CI and they do not add tests:full. A new push runs this check again.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@github-actions github-actions Bot added the ai:review-lgtm AI first review found no blocker or major issue (advisory) label Nov 10, 2026
@codecov

codecov Bot commented Nov 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai:ci-safe AI triage found no CI-safety concern (advisory) ai:review-lgtm AI first review found no blocker or major issue (advisory) bug Something isn't working jats issue related to JATS XML backend xml issue related to supported schema-specific XML formats

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JATS: links in back-matter <fn-group> footnotes lose their URL

2 participants