Skip to content

fix(odf): move hidden ODT sections to the invisible content layer - #4860

Merged
PeterStaar-IBM merged 1 commit into
docling-project:mainfrom
ankit2235:fix/odt-hidden-sections
Oct 16, 2026
Merged

PeterStaar-IBM merged 1 commit into
docling-project:mainfrom
ankit2235:fix/odt-hidden-sections

Conversation

@ankit2235

Copy link
Copy Markdown
Contributor

Summary

LibreOffice Writer can hide a section (Format > Sections > Hide). It saves the
section as <text:section text:display="none">, and the section is not shown
or printed. The ODT backend ignored this attribute, so the content of a hidden
section went to the body and appeared in every export.

This change moves the content of a hidden section to ContentLayer.INVISIBLE.
This is the same as for hidden ODS sheets, hidden PPTX slides (#4647), hidden
PPTX shapes (#4733) and hidden ODP slides (#4767). The content is still
available with included_content_layers.

Nested sections inside a hidden section also stay invisible. Sections that are
shown keep their current behavior.

Scope

  • Only text:display="none" is handled. A conditional section
    (text:display="condition") needs evaluation of its formula, so it stays in
    the body.

Tests

  • Added test_odt_hidden_section_goes_to_invisible_layer.
  • uv run pytest tests/test_backend_opendocument.py passes.
  • No reference data changes.

Signed-off-by: Ankit Kumar <ankitkumar19473@gmail.com>
@github-actions

Copy link
Copy Markdown
Contributor

✅ DCO Check Passed

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

@mergify

mergify Bot commented Oct 15, 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 odf Issue related to the OpenDocument format (ODT, ODS, ODP) backend labels Oct 15, 2026
@github-actions

Copy link
Copy Markdown
Contributor

AI triage (advisory)

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

The ODT backend now moves the content of a section with text:display="none" to ContentLayer.INVISIBLE, nested sections included. A new test covers this.

Topic labels added: bug, odf.

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

3 related pull request(s) in the same code
PR State Signal Assessment
#4767 merged referenced as #4767 related: The merged PR hides ODP slides in the same backend file. This PR hides ODT sections in a different code path.
#4733 merged referenced as #4733 related: The merged PR hides PPTX shapes. It follows the same invisible-layer idea but changes a different backend.
#4647 merged referenced as #4647 related: The merged PR hides PPTX slides. It follows the same invisible-layer idea but changes a different backend.

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 6045214ed8. It read the code and did not run it.

Checked that hidden ODT sections with text:display="none" and their nested elements assign to ContentLayer.INVISIBLE without affecting sibling elements.

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

codecov Bot commented Oct 16, 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 merged commit f690a52 into docling-project:main Oct 16, 2026
33 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 odf Issue related to the OpenDocument format (ODT, ODS, ODP) backend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants