Repository navigation
Conversation
LibreOffice Impress stores each slide comment as an officeooo:annotation element, the last child of the draw:page. OdpDocumentBackend._walk_slide passed every other non-frame element's children to _walk_textbox_children, so the comment text became slide body text, the author and date were dropped, and the NOTES layer stayed empty. Skip officeooo:annotation in _walk_slide (and in _slide_has_visible_title, so comment text cannot affect title detection), and extract the comments in a new _extract_slide_comments pass. As in the PPTX backend, each comment becomes a COMMENT_SECTION group in the NOTES layer, keeping the '[author: Name (initials), time: date]: text' form. Add a regression test with a fixture ODP carrying slide comments (tests/data/odf/sources/odf_presentation_with_slide_comment.odp) and its e2e groundtruth. Resolves docling-project#4648 Signed-off-by: Junyi Yao <j.yao@wustl.edu>
Contributor
|
✅ DCO Check Passed Thanks @Kylinny, all your commits are properly signed off. 🎉 |
Contributor
Merge Protections🔴 1 of 2 protections blocking · waiting on 👀 reviews
🔴 Require two reviewer for test updatesWaiting for
This rule is failing.When test data is updated, we require two reviewers
Show 1 satisfied protection🟢 Enforce conventional commitMake sure that we follow https://www.conventionalcommits.org/en/v1.0.0/
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
LibreOffice Impress stores each slide comment as an
officeooo:annotationelement, the last child of thedraw:page.OdpDocumentBackend._walk_slidepassed every other non-frame element's children to_walk_textbox_children, so the comment text became slide body text, the author and date were dropped, and theNOTESlayer stayed empty.The fix mirrors the PPTX backend (and the ODT backend since #4436):
_walk_slideand_slide_has_visible_titleskipofficeooo:annotation. Comment text no longer leaks into the slide body text or the Markdown export, and it cannot affect title detection._extract_slide_commentspass runs per slide, inside thepage_rangefilter. As in the PPTX backend, each comment becomes aCOMMENT_SECTIONgroup in theNOTESlayer, namedcomment-slide{N}-{M}. The text keeps the[author: Name (initials), time: date]: textform. A comment without author or date keeps only its text. An empty comment is skipped.Behavior on the repro script from the issue:
title 'Q3 results',text 'Revenue grew 4%.',text 'Check this number.'title 'Q3 results',text 'Revenue grew 4%.'Check this number.COMMENT_SECTIONgroupcomment-slide1-1with[author: Ann Reviewer (AR), time: 2024-01-15T10:00:00]: Check this number.Issue resolved by this Pull Request:
Resolves #4648
Checklist:
Review evidence:
New
test_odp_slide_comment_becomes_comment_not_body_textuses the new fixturetests/data/odf/sources/odf_presentation_with_slide_comment.odp(two slides; comments with full metadata, with no author/date, and multi-paragraph). It asserts the Markdown export, the body-layer texts, and the comment groups (names, NOTES layer, exact texts). The test fails on the base commit and passes with the fix. E2E groundtruth (.md/.itxt/.html/.json) is added for the new fixture; no existing groundtruth file changes.Checks run:
tests/test_backend_opendocument.py— 53 passed;ruff checkandruff format --checkpass on both changed files.