Skip to content

fix(jats): keep the text of inline <term> elements - #5177

Merged
PeterStaar-IBM merged 1 commit into
docling-project:mainfrom
Fahmid-Arman:fix/jats-term-text
Nov 5, 2026
Merged

PeterStaar-IBM merged 1 commit into
docling-project:mainfrom
Fahmid-Arman:fix/jats-term-text

Conversation

@Fahmid-Arman

Copy link
Copy Markdown
Contributor

Issue resolved by this Pull Request:
Resolves #5176

The JATS backend skipped <term> elements in both _get_text (titles, captions) and _walk_linear (paragraphs), so a defined term inside running text vanished from the sentence. <term> is no longer skipped, and the now-unused skip list in _walk_linear is removed. Formulas are still skipped in _get_text as before.

Checklist:

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

Review evidence:

Source Before After
<title>The <term>PCR</term> step</title> The step The PCR step
<p>The <term>polymerase chain reaction</term> amplifies DNA.</p> The amplifies DNA. The polymerase chain reaction amplifies DNA.
  • Definition lists (<def-list>) produce the same output as before. Their terms are still not emitted, because there is no def-list handling yet; the issue describes that separately.
  • No reference data changes: none of the sources in tests/data/jats contains <term>.
  • New test_jats_inline_term_keeps_its_text in tests/test_backend_jats.py covers the heading and the paragraph. It fails on main and passes with the change.
  • pytest tests/test_backend_jats.py: 93 passed.
  • ruff format and ruff check are clean on the changed files.
  • Not run: the full suite, because PDF and OCR extras aren't installed here.

@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

✅ DCO Check Passed

Thanks @Fahmid-Arman, all your commits are properly signed off. 🎉

@mergify

mergify Bot commented Nov 4, 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 xml issue related to supported schema-specific XML formats labels Nov 4, 2026
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

AI triage (advisory)

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

The JATS backend no longer skips inline <term> elements. Defined terms now stay in titles, captions, and paragraph text. A new test covers a heading and a paragraph.

Topic labels added: bug, 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 79527224fb. It read the code and did not run it.

Checked that removing <term> from skip lists in docling/backend/xml/jats_backend.py:321 and docling/backend/xml/jats_backend.py:1338 preserves inline term text in titles and paragraphs without regressions in formula handling or inline segmentation.

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 4, 2026
@codecov

codecov Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@PeterStaar-IBM PeterStaar-IBM left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm

@PeterStaar-IBM
PeterStaar-IBM merged commit fc7df25 into docling-project:main Nov 5, 2026
34 checks passed
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 xml issue related to supported schema-specific XML formats

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JATS: text inside <term> elements is dropped from paragraphs and titles

2 participants