Repository navigation
fix(latex): keep the items of an \input file in the open list - #5413
Conversation
Since #4518 the list handler splits a list body into items before it reads an \input file. The \item lines of the file were then processed inside the previous item, so they became plain text and the later items got the wrong numbers. Read each \input file of a list body first and splice its nodes into the body, as LaTeX does with plain text inclusion. The file reading moves to _read_input(), which keeps the path, cycle and depth checks of the \input handler. Signed-off-by: Christoph Auer <[email protected]>
|
✅ DCO Check Passed Thanks @cau-git, 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/
|
AI triage (advisory)Checked commit The PR fixes the LaTeX list handler so that Topic labels added: CI safety: no concern found. A maintainer must still approve CI. 1 related pull request(s) in the same code
The |
There was a problem hiding this comment.
AI first review (advisory): no blocker found
This review covers the full diff at e039453704. It read the code and did not run it.
I found no defect that must stop the merge. The change reads each \input file in a list body before it splits the body into items. It keeps the path-traversal, cycle and depth checks, and the new test covers the self-including file. The \input handler now calls _read_input() too, and it behaves as before.
A maintainer makes the merge decision. This review never approves the pull request.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Since #4518, the LaTeX list handler splits a list body into items before it reads an
\inputfile. The\itemlines of that file were then processed inside the previous item. They became plain text, and the later items got the wrong numbers.This change reads each
\input/\includefile of a list body first and splices its nodes into the body, as LaTeX does with plain text inclusion. The file reading moves to_read_input(). It keeps the path-traversal, cycle and depth checks of the\inputhandler, and the splice uses the same cycle and depth guard.Checklist:
Review evidence:
Source:
1. Paper A, thenPaper BandPaper Cas plain lines, then2. Paper D.1. Paper Ato4. Paper D.\input{items}still gives 2 items, as before.Tests:
tests/test_latex/test_lists.py::test_latex_list_items_from_input_file. The included file also inputs itself, so the test checks that the cycle is skipped. The test fails without the fix and passes with it.pytest tests/test_latex: 219 passed, 1 skipped, 5 xfailed.