fix: nested loops work - preserve inner loop_end markers

This commit is contained in:
2026-07-31 00:29:12 +04:00
parent 745e70a164
commit c5466f2992
2 changed files with 39 additions and 20 deletions
+2 -2
View File
@@ -9,7 +9,7 @@ sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
from dokogen.models import Company, CommissionMember, InformationSystem
from dokogen.variables import build_replacements
from dokogen.generator import process_template, _expand_loops_in_zip
from dokogen.generator import process_template, expand_loops_in_zip
def create_test_template():
"""Creates a test .docx with nested loops for verification."""
@@ -108,7 +108,7 @@ def test_zip_loop_expansion():
# Process with ZIP-level loop expansion
print('\nProcessing loops via ZIP...')
result_path = _expand_loops_in_zip(template_path, loops)
result_path = expand_loops_in_zip(template_path, loops)
# Verify result
with zipfile.ZipFile(result_path, 'r') as z: