You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In a project with multiple layers of subdocuments, when inserting a subdocument containing any type of list, its style get inconsistently modified.
A similar bug ( #500 ) was reported more than a year ago (and still isn't fixed), but this one shows deeper inconsistencies, such as numbered lists becoming bullet lists, bullet lists becoming numbered list and numbered lists merged together or restarting their count.
To Reproduce
(all tested with python 3.11.8, docxtpl 0.19.1 and python-docx 1.1.2)
2 tests are made to show different ways the bugs manifest themselves.
In the first one, a docx template is made with 2 numbered lists and 2 bullet lists generated from the variables
In the second one, only one numbered list and one bullet list are used
Both templates are shown on the first file on the left side of each screenshots.
Then, for each test, the file is embedded 3 times through the same template consisting only of a single variable:
{{ PREVIOUS_FILE }}
Finally, the python script to generate the files is run as is:
All generated files should be identical to the first one (second file on the left on each screenshot).
Instead, for the first test, on the 3rd file, all bullet points get turned into numbered lists and all four lists are treated as a single one, and on the fourth file, the second item of the first list start a new counter for the remaining items.
And on the second test, the numbered list gets converted into bullet points instead on the third file. On the fourth one, they all turn back into numbered list just like for the first test, including counting twice the first item.
Screenshots
Additional context
Different templates can generate different results. Running the same test with the same template multiple times seems to consistently generate the same errors, and changing the number of items per list in the variables doesn't seem to influence how the bugs manifest themselves.
Those are only a sample of what I encountered on my personal project that I could minimally reproduce, but I have also encountered other bugs, such as the text content of a cell in a table being converted into a bullet list, or left indent on bullet list changing from 0 to the default Word value randomly.
This is becoming extremely irritating because each time I try to add something, there's a new bug that require manual editing at the end of my pipeline!
The text was updated successfully, but these errors were encountered:
Describe the bug
In a project with multiple layers of subdocuments, when inserting a subdocument containing any type of list, its style get inconsistently modified.
A similar bug ( #500 ) was reported more than a year ago (and still isn't fixed), but this one shows deeper inconsistencies, such as numbered lists becoming bullet lists, bullet lists becoming numbered list and numbered lists merged together or restarting their count.
To Reproduce
(all tested with python 3.11.8, docxtpl 0.19.1 and python-docx 1.1.2)
2 tests are made to show different ways the bugs manifest themselves.
Both templates are shown on the first file on the left side of each screenshots.
Then, for each test, the file is embedded 3 times through the same template consisting only of a single variable:
{{ PREVIOUS_FILE }}
Finally, the python script to generate the files is run as is:
Expected behavior
All generated files should be identical to the first one (second file on the left on each screenshot).
Instead, for the first test, on the 3rd file, all bullet points get turned into numbered lists and all four lists are treated as a single one, and on the fourth file, the second item of the first list start a new counter for the remaining items.
And on the second test, the numbered list gets converted into bullet points instead on the third file. On the fourth one, they all turn back into numbered list just like for the first test, including counting twice the first item.
Screenshots
Additional context
Different templates can generate different results. Running the same test with the same template multiple times seems to consistently generate the same errors, and changing the number of items per list in the variables doesn't seem to influence how the bugs manifest themselves.
Those are only a sample of what I encountered on my personal project that I could minimally reproduce, but I have also encountered other bugs, such as the text content of a cell in a table being converted into a bullet list, or left indent on bullet list changing from 0 to the default Word value randomly.
This is becoming extremely irritating because each time I try to add something, there's a new bug that require manual editing at the end of my pipeline!
The text was updated successfully, but these errors were encountered: