Skip to content

fix(import): stop short-section pdfs collapsing and step numbers swallowing chapters - #132

Merged
vishwajeet-13 merged 2 commits into
bwhtech:mainfrom
vishwajeet-13:fix/short-sections-and-step-numbers
Oct 10, 2026
Merged

vishwajeet-13 merged 2 commits into
bwhtech:mainfrom
vishwajeet-13:fix/short-sections-and-step-numbers

Conversation

@vishwajeet-13

@vishwajeet-13 vishwajeet-13 commented Oct 10, 2026 •

Copy link
Copy Markdown
Collaborator

Two regressions from #124, found by re-importing PDFs on main.

  1. A PDF made of short topics became one wiki page. repeat_prescribing_protocol.pdf (36 pages) ended up as a single "Preamble" page, with "Page N" lines and "Chapter > Section" breadcrumbs left in the text.
    • The breadcrumb now becomes the chapter heading, "(continued)" headings fold into their section, and "Page N" is stripped.
    • If no top-level section qualifies as a page, the sections that start a new PDF page still become pages.
  2. A numbered step was read as a chapter. In erpnext-upgrade-playbook.pdf, the step badges came through as headings ("1", "2", "3 Run bench migrate"), so step 3 swallowed every chapter after it. A numbered heading that continues a run of bare step numbers on its page is now a list step.

I re-ran the section tree and page plan on all 61 stored imports. Only these two PDFs change.

Screenshots

Short-topic PDF

Before After

Numbered step

Before After

…lowing chapters

- cleanup: a "Page N" label at the page edge is stripped like a bare page number
- cleanup: a running "Chapter > Section" breadcrumb becomes the chapter heading, with the page's heading nested under it
- sectionize: a "Topic (continued)" or "Continued from the previous page" heading folds into the open section
- sectionize: a numbered heading that continues a run of bare step numbers on its page is a list step, not a chapter
- page plan: when no top-level section qualifies as a page, the ones that open a pdf page still are

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your trial has ended. Reactivate Greptile to resume code reviews.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your trial has ended. Reactivate Greptile to resume code reviews.

@vishwajeet-13
vishwajeet-13 merged commit 7934601 into bwhtech:main Oct 10, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant