mirror of
https://github.com/Tencent/WeKnora.git
synced 2026-09-19 02:18:25 +08:00
Children were forced to StrategyRecursive on the assumption that re-profiling each parent would be too expensive. In practice profiling each parent is bounded by O(sum(parent_size)) ≈ O(N) total, the same order as the original parent profiling pass — and the gain is real: when a parent (e.g. an H1 chapter) contains its own sub-headings, the heading splitter on child input now picks them up and generates a finer-grained breadcrumb instead of every child sharing the parent's top-level breadcrumb. Add mergeBreadcrumbs to combine the parent ContextHeader with the child's freshly-derived one, dropping the duplicated seam line that appears when the child's first heading equals the parent's last. Tests cover (a) sub-headings now appearing in child breadcrumbs and (b) the merge dedup against duplicated seam lines.