fix(markdown): recognize extractor bullet glyphs (▪ ‣ ◆) as list items - #476
shahidbeig-a11y wants to merge 11 commits into
Conversation
Align is_list_item(), starts_with_bullet_marker(), and format_list_item() with the bullet glyph set already used by extractor/layout.rs and extractor/underline.rs. PDF lists using ▪, ‣, ◆ (and related markers) were emitted as plain paragraphs and could be misclassified as headings. Closes firecrawl#475 Co-authored-by: shahidbeig-a11y <shahidbeig-a11y@users.noreply.github.com>
Add BULLET_GLYPHS shared constant and use it in list detection, formatting, and standalone bullet merging. Keeps - and * as separate checks; excludes middle dot and dash glyphs. Fixes firecrawl#475 Co-authored-by: shahidbeig-a11y <shahidbeig-a11y@users.noreply.github.com>
Add explicit ▪/‣/◆ detection and format tests, middle-dot negative format case, numbered list assertions, and heading rejection test. Co-authored-by: shahidbeig-a11y <shahidbeig-a11y@users.noreply.github.com>
There was a problem hiding this comment.
1 issue found and verified against the latest diff
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/markdown/classify.rs">
<violation number="1" location="src/markdown/classify.rs:4">
P2: When a PDF places `‣` or `⁃` in standalone marker items, column detection can mistake the marker gutter for a real column because its marker guard does not know these newly supported glyphs. Add the glyphs to the layout marker set or share `BULLET_GLYPHS` so these list items reach markdown intact.</violation>
</file>
Shadow auto-approve: would not auto-approve because issues were found.
Fix all with cubic | Re-trigger cubic
| //! Line classification: captions, lists, code detection. | ||
|
|
||
| pub(crate) const BULLET_GLYPHS: &[char] = | ||
| &['•', '●', '○', '◦', '▪', '▫', '◆', '◇', '■', '□', '‣', '⁃']; |
There was a problem hiding this comment.
P2: When a PDF places ‣ or ⁃ in standalone marker items, column detection can mistake the marker gutter for a real column because its marker guard does not know these newly supported glyphs. Add the glyphs to the layout marker set or share BULLET_GLYPHS so these list items reach markdown intact.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/markdown/classify.rs, line 4:
<comment>When a PDF places `‣` or `⁃` in standalone marker items, column detection can mistake the marker gutter for a real column because its marker guard does not know these newly supported glyphs. Add the glyphs to the layout marker set or share `BULLET_GLYPHS` so these list items reach markdown intact.</comment>
<file context>
@@ -1,5 +1,15 @@
//! Line classification: captions, lists, code detection.
+pub(crate) const BULLET_GLYPHS: &[char] =
+ &['•', '●', '○', '◦', '▪', '▫', '◆', '◇', '■', '□', '‣', '⁃'];
+
+fn starts_with_bullet_glyph_and_space(text: &str) -> bool {
</file context>
There was a problem hiding this comment.
0 issues found across 2 files (changes from recent commits).
Shadow auto-approve: would not auto-approve. Auto-approval blocked by 2 unresolved issues from previous reviews.
Re-trigger cubic
Consolidate classify.rs cases per architect spec and add square-bullet merge-items stream-order regression test. Co-authored-by: shahidbeig-a11y <shahidbeig-a11y@users.noreply.github.com>
There was a problem hiding this comment.
All reported issues were addressed across 2 files (changes from recent commits).
Shadow auto-approve: would not auto-approve because issues were found.
Tip: Review your code locally with the cubic CLI to iterate faster.
Fix all with cubic | Re-trigger cubic
Add is_standalone_bullet_glyph helper so is_list_marker_column picks up ‣ and ⁃, and test every BULLET_GLYPHS entry in list-item QA. Co-authored-by: shahidbeig-a11y <shahidbeig-a11y@users.noreply.github.com>
There was a problem hiding this comment.
0 issues found across 3 files (changes from recent commits).
Shadow auto-approve: would not auto-approve. Auto-approval blocked by 2 unresolved issues from previous reviews.
Re-trigger cubic
There was a problem hiding this comment.
All reported issues were addressed
Shadow auto-approve: would not auto-approve because issues were found.
Fix all with cubic | Re-trigger cubic
There was a problem hiding this comment.
1 existing issue remains and 1 new issue found across 5 files
Confidence score: 3/5
src/extractor/layout.rscan create a spurious column for standalone■,□,◆, or◇markers, scrambling PDF list reading order; preserve the marker/content-gutter rejection guard.src/markdown/classify.rsmay drop standalone newly supported bullet glyphs near charts by classifying them as labels, so align the chart guard withis_standalone_bullet_glyphor the shared glyph set.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/markdown/classify.rs">
<violation number="1" location="src/markdown/classify.rs:6">
P2: When a newly supported bullet glyph is a standalone item near a chart, the chart filter still treats it as a label and drops it. Make the chart guard use `is_standalone_bullet_glyph` or the shared glyph set instead of its stale hard-coded list.</violation>
</file>
Shadow auto-approve: would not auto-approve because issues were found.
Fix all with cubic | Re-trigger cubic
There was a problem hiding this comment.
1 issue found and verified against the latest diff
Confidence score: 4/5
- In
src/markdown/classify.rs, standalone▪,▫,‣, or⁃markers in chart padding can be omitted from the extracted list because their classification does not reach the chart-label filter; reuseis_standalone_bullet_gly...so these markers are retained.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/markdown/classify.rs">
<violation number="1" location="src/markdown/classify.rs:9">
P2: When a standalone `▪`, `▫`, `‣`, or `⁃` lies in chart padding, the new marker classification does not reach the chart-label filter, so the marker can be dropped from the extracted list. Reuse `is_standalone_bullet_glyph` in that filter instead of maintaining the old hard-coded marker list.</violation>
</file>
Shadow auto-approve: would not auto-approve because issues were found.
Fix all with cubic | Re-trigger cubic
Reuse is_standalone_bullet_glyph in chart-adjacent label filtering so standalone ▪▫‣⁃ near charts are not dropped. Keep ◆◇■□ as layout-only gutter markers so list columns still reject spurious valleys. Drop the vacuous heading-sequence assert on a singleton ▪ line. Addresses cubic review on firecrawl#476.
There was a problem hiding this comment.
1 existing issue remains and no new issues found across 3 files (changes from recent commits).
Confidence score: 5/5
src/markdown/mod.rsextends the chart-padding marker guard to ▪, ▫, ‣, and ⁃, but the chart-region test covers only•; loop over the new glyphs inchart_padding_claims_labels_but_not_adjacent_proseto prevent regressions.
Shadow auto-approve: would not auto-approve. Auto-approval blocked by 3 unresolved issues from previous reviews.
Re-trigger cubic
Loop chart_padding_claims_labels_but_not_adjacent_prose over the standalone glyphs the chart-label filter now preserves, so a regression that only keeps • would fail. Addresses cubic review on firecrawl#476.
There was a problem hiding this comment.
All reported issues were addressed across 1 file (changes from recent commits).
Shadow auto-approve: would not auto-approve because issues were found.
Tip: Review your code locally with the cubic CLI to iterate faster.
Fix all with cubic | Re-trigger cubic
|
Follow-up: chart-padding guard test now iterates |
There was a problem hiding this comment.
0 issues found across 1 file (changes from recent commits).
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Shadow auto-approve: would not auto-approve. Auto-approval blocked by 1 unresolved issue from previous reviews.
Re-trigger cubic
Fixes #475
Summary by cubic
Recognizes additional bullet glyphs (▪ ‣ ⁃ and related) as list items in markdown extraction, so PDF lists using them are no longer emitted as plain paragraphs or misclassified as headings. Large squares and diamonds (■ □ ◆ ◇) stay out of list detection because documents use them as decorative heading prefixes, but remain layout-only gutter markers so list columns still reject spurious column splits. Fixes #475.
BULLET_GLYPHSandis_standalone_bullet_glyphacross list detection, formatting, standalone bullet merging, the layout marker guard, and chart-adjacent label filtering.-and*as separate checks and excludes middle dot, en dash, and em dash.Written for commit 0fb69bb. Summary will update on new commits.