hot-fix 0.4.3
Python application / build (push) Has been cancelled

- fix Не появляется пустая странициа перед названием таблицы
- fix Не появляется пустая страница перед альбомной ориентацией
- fix При отказе от изменений создаётся новый файл
- fix Замена "..." на «...» больше не затрагивает uml и mermaid блоки
This commit is contained in:
Igor20264
2026-09-05 10:24:13 +03:00
parent 8508d04bbc
commit febf62c257
18 changed files with 267 additions and 49 deletions
+11 -5
View File
@@ -95,12 +95,11 @@ class Renderer:
self._landscape_depth += 1
return
self._flush_to_new_screen()
if self._after_toc:
self._ensure_body_section_with_page_numbers()
elif not self._body_section_started:
# No TOC — still need page numbers on subsequent sections.
if not self._body_section_started:
# Do not add_section(portrait) here. A portrait NEW_PAGE plus the
# landscape NEW_PAGE below is two breaks: text → empty portrait → album.
self._body_section_started = True
apply_centered_page_footer(self._document.sections[0])
apply_centered_page_footer(self._document.sections[-1])
section = self._document.add_section(WD_SECTION.NEW_PAGE)
apply_section_geometry(section, landscape=True)
apply_centered_page_footer(section)
@@ -366,6 +365,13 @@ class Renderer:
extra = self._after_current.pop(0)
self.render(extra)
if isinstance(renderable, ToC):
# One NEXT_PAGE section after the TOC field — not a w:br plus a section.
self._ensure_body_section_with_page_numbers()
state = self._layout_tracker.current_state
if state.current_page_height > 0:
self._layout_tracker.new_page()
if deferred_listing is not None:
self.render(deferred_listing)