- fix Не появляется пустая странициа перед названием таблицы - fix Не появляется пустая страница перед альбомной ориентацией - fix При отказе от изменений создаётся новый файл - fix Замена "..." на «...» больше не затрагивает uml и mermaid блоки
This commit is contained in:
+11
-5
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user