Commit Graph

4 Commits

Author SHA1 Message Date
Bingxi Zhao (Frank)
98529ad0c7 fix(chat, text): replay the visible failed turn and retain repeated section titles 2026-09-23 11:03:23 +08:00
Bingxi Zhao (Frank)
ad958a5cd7 fix(textbook): retain shared boundary pages in chapter spans 2026-09-23 10:44:09 +08:00
Bingxi Zhao (Frank)
c323516312 fix(textbook): expose header rebuild and preserve final page range 2026-09-23 10:38:16 +08:00
interia
4a01a8cffc feat(textbook): rebuild chapters from running headers embedded mid-text
Some publishers print the chapter name embedded mid-text in the running
header (e.g. "集合第1章", "空间向量与立体几何 第6章"), often without a
leading "第", while the footer only carries the publisher name — a
footer-only pass then finds zero chapters.

page_facts() now reads chapter-shaped furniture from both positions:
footer blocks matching CHAPTER_RE verbatim, and header blocks whose
chapter token sits mid-text, extracted via HEADER_CHAPTER_RE and
normalized to the canonical "第N章 章名" shape by
normalize_header_chapter() (bare token / name-before-token /
name-after-token forms; book titles, token-less headers and long prose
are rejected as boundaries). Both channels share the existing level
filter and seen-dedupe; the printed-page offset check verifies boundary
correctness end to end. Covered by 9 new tests including two-level
running-header unit filtering and offset constancy.
2026-09-11 13:30:58 +08:00