firecrawl / firecrawl/pdf-inspector

Closed stroked paths (h then S) never reach underline detection

Open
#196 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
19.1k
Forks
1.3k
Avg merge
9h 21m
Merged PRs (30d)
51

Description

## Bug

Page content that underlines text with a closed stroked path (`m` / `l` / `h` / `S`) never marks `is_underline`.

After `h`, the walker moves segments into `pending_subpaths` and clears `pending_lines`. The `S` / `s` / `B` / `b*` handlers only drain `pending_lines`, then `pending_subpaths.clear()` — so the closed rule is dropped before `mark_underlined_items`.

Open paths (`m` / `l` / `S` without `h`) still work.

## Expected

Closed horizontal thin strokes should mark underlines the same as open strokes.

## Repro (synthetic content)

```
BT /F1 12 Tf 1 0 0 1 100 500 Tm (CLOSED) Tj ET
1 w
100 498 m 160 498 l h S
```

## Notes

Related to Form XObject path work in #193 / #126 (same subpath-drain pattern). This issue is the page-level walker on `main`.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at the page-level walker on main and trace how h moves segments into pending_subpaths before mark_underlined_items. Compare the S, s, B, and b* handlers with the open-path flow, using the synthetic m/l/h/S content as the reproduction. Done means the closed thin horizontal stroke marks the text as is_underline without regressing open paths.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.