Skip to content

fix(import): keep short pdfs, stitch long tables and stop doubled or dropped charts - #129

Merged
vishwajeet-13 merged 1 commit into
bwhtech:fix/nephrology-fidelityfrom
vishwajeet-13:fix/pr124-review-fixes
Oct 10, 2026
Merged

vishwajeet-13 merged 1 commit into
bwhtech:fix/nephrology-fidelityfrom
vishwajeet-13:fix/pr124-review-fixes

Conversation

@vishwajeet-13

Copy link
Copy Markdown
Collaborator

Fixes the bugs from my test comment on #124. Each one was reproduced first, then re-checked by importing the same PDFs again.

  • Short PDFs no longer give an empty wiki. Children of a section that isn't a page no longer crash with a KeyError.
  • Image tags the VLM makes up now mark where the crop goes, instead of turning into a full-page image next to it.
  • A table over 3+ pages is joined at every page break, and its section keeps the right page range.
  • A chart is kept when a real typed table follows it (checked against the PDF text layer).
  • Lettered sub-steps (a, b, iv.) stay as their own table rows.
  • A numbered data table under its own header isn't read as a contents page.
  • Section headings repeated across a long doc are no longer stripped as running headers.

Screenshots

Charts PDF: one crop instead of two full-page copies

Before After

Two-column paper: chart was dropped because a table follows it

Before After

1-page memo: was an empty wiki, now:

75-row table over 3 pages (section markdown at the 2nd page break)

Before                                  After
| Acyclovir #48 | ... |                 | Acyclovir #48 | ... |
                                        | Amoxicillin #49 | ... |
| Drug | Class | CrCl >50 | ... |       | Gabapentin #50 | ... |
|---|---|---|---|                       
| Amoxicillin #49 | ... |

…dropped charts

- page plan: a doc with no page-worthy section keeps its first section as the page, and children of a leading section fold with it instead of raising KeyError
- figures: image tags the vlm made up mark where crops go instead of turning into full-page images
- tables: a table over three or more pages is joined at every page break, and its section keeps the pages the rows came from
- tables: lettered sub-step rows are no longer merged into the numbered row above
- contents: a numbered data table under its own header is not read as a contents page
- figures: a chart followed by a table typed on the page is kept
- boilerplate: the low repeat threshold applies only to the outermost edge line, so repeated section headings survive

@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 ab79ad2 into bwhtech:fix/nephrology-fidelity 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