Repository navigation
Conversation
|
✅ DCO Check Passed Thanks @ryanmeowy, 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/
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
AI triage (advisory)Checked commit The PR fixes the ODF backend so it keeps the text of a table of contents and of other index kinds. It treats the index container elements as transparent, in the same way as 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 c6beb713ea. It read the code and did not run it.
The fix is small and handles a table of contents correctly. The main risk is that the same data loss stays for the other ODF index types. The reviewer must decide whether to widen the tag set in this PR or to track those types in a follow-up issue.
A maintainer makes the merge decision. This review never approves the pull request.
A table of contents holds its visible text in the index containers, as ordinary paragraphs. The backend matched none of them, so the element reached the branch that reads images only and the paragraphs of the index body were never visited. The index containers now use the transparent branch of the section element, so their paragraphs become text items. The index title template stays out: it is not part of the rendered index. Signed-off-by: Ryan Yang <ryanxys@gmail.com>
The index containers were matched for a table of contents only. An alphabetical, illustration, table, object, or user index, and a bibliography, hold their entries in the same containers, so the same text was dropped. All the index kinds are now matched. The test checks the item labels as well as the text order, and covers each index kind. Signed-off-by: Ryan Yang <ryanxys@gmail.com>
c6beb71 to
e59721f
Compare
There was a problem hiding this comment.
AI first review (advisory): no blocker found
This review covers the full diff at e59721f16c. It read the code and did not run it.
I found no finding that decides the merge. The change makes the index containers transparent, the same way text:section already is, and the two new tests cover the table of contents and the other index kinds. The odfdo package in the environment has no class for these tags, so the tag-based match is needed.
A maintainer makes the merge decision. This review never approves the pull request.
Issue resolved by this Pull Request:
Resolves #4749
Checklist:
tests/test_backend_opendocument.pybuilds an ODT for a table of contents and for each other index kind, and asserts the text and the item labels.Review evidence:
Behavior before. The body of the ODT holds two paragraphs and a table of contents with an index title and two entries. The export holds the two paragraphs only:
The document has two text items.
_add_odf_child()sends the index element to the branch that reads images only, so the paragraphs insidetext:index-bodyare never visited. Every index kind of ODF 1.2 has its own tag and meets the same branch.Behavior after.
Document tree: the index title and the entries are
DocItemLabel.TEXTitems in document order, between the two paragraphs, and no other item is added. Thetext:index-title-templateoftext:table-of-content-sourcestays out of the document: it is a template, and LibreOffice renders thetext:index-titleparagraph of the index body.The index containers are transparent now, the same way
text:sectionis. The containers aretext:index-bodyandtext:index-title, and they hold the entries of every index kind:text:table-of-content,text:alphabetical-index,text:illustration-index,text:table-index,text:object-index,text:user-indexandtext:bibliography. The hidden section behavior stays:text:display="none"sends the content to the invisible content layer, and the same holds for a hidden index.Checks.
pytest tests/test_backend_opendocument.py -k table_of_contentswithout the source changepytest tests/test_backend_opendocument.py -k indexwithout the source changepytest tests/test_backend_opendocument.pypytest tests/test_cli.py tests/test_input_doc.pyruff format --checkandruff checkon the two changed filesscripts/check_max_lines.pymain; the two changed files are exempted in.github/max-lines-ignorety checkmain, none on the new linesNo reference-data changes: no fixture under
tests/data/holds an index element, and the new tests build their own documents.Scope: this branch is rebased onto
mainat the writing time. The rebase keeps the hidden section handling of #4860.