Skip to content

Sectionizer treats a long prose clause as a heading #6

Description

@Rl0007

Split out of #4 / #5, which fix only the crash.

What

On page 72 of Nephrology.pdf (IMP-2026-00001) the cleanup remediation pass promoted a bold numbered clause into a real heading:

## 5. The transplant coordinator also has the responsibility to maintain up to date records and reports as required for the Renal Transplant license.

sectionize() believes it and opens a section. #5 stops that from failing the import by truncating the title, so the tree now gets a section titled "5. The transplant coordinator also has the responsibility to maintain up to date records and reports as required for the Renal…" — the import passes, the tree is still wrong, and the wiki gets a page for it.

The existing _looks_like_list_item guard doesn't catch this: it only fires on a stray * or double numbering, and only for level-1 headings. This one is a clean ##.

Direction

A heading that runs long and closes like a sentence is body text the parser or the cleanup pass mis-promoted — real headings are short and rarely end in terminal punctuation. It should stay in the section it was found in rather than opening one, with the embedded ToC still authoritative where it lists the title.

Before implementing

The threshold is the whole question, and it should not be guessed. Sweep the existing Source Section titles across every document on wikify.m.frappe.cloud, and pick the length and punctuation rule from what that shows — including how many current headings the rule would reclassify. This changes how every document is split, so the regression surface is real.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions