Repository navigation
fix(documents): split no-TABLE and <PAGE> plain-text filings, print a table caption once (llmp.12.1) - #1534
Merged
Conversation
… table caption once (edgartools-llmp.12.1, edgartools-2f4l0) Three follow-ups to #1531, all measured on dev fixtures: - A plain-text filing with no <TABLE> is one pre-wrap <div> of bare text, which _is_text_only_container built as a ParagraphNode, so its blank-line blocks could not split. Such a div now builds as a container. - An unclosed SGML <PAGE> marker nested the rest of a filing in an inline element. The parser drops the marker from plain-text input. - Regulation S-B 10-Ks title Items 1 and 2 "Description of Business" and "Description of Property"; both are appended, item-numbered only, and the 10-K pattern golden re-snapshotted with every existing pattern verified byte-identical. Unsplitting the <PAGE> S-1 exposed edgartools-2f4l0: both table renderers open with the caption and TextExtractor._extract_table appended it again, so every captioned table printed its caption twice, and an SGML <CAPTION> holds the whole table. The caption is now added only when the rendered table does not already open with it. Over 43 plain-text fixtures, 128k words go, every one of them a skipped caption's (checked per fixture), and none are gained. Held-out 10-K (report only, no held-out filing used): both-exact 85.1% -> 86.8%, recall 96.4% -> 98.2%; 2001-06 both-exact 64.2% -> 72.1%. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dgunning
enabled auto-merge (squash)
October 13, 2026 10:02
1 of 6 tasks
6 of 9 tasks
dgunning
pushed a commit
that referenced
this pull request
Oct 18, 2026
…tement (GH #1563) (#1564) * fix(sections): end an 8-K's last item at a preformatted signature statement (GH #1563) An 8-K whose primary document is one preformatted (<pre>) block of plain text kept the SIGNATURE block inside its last item, the behavior #1393 had already fixed for other layouts. #1534 split a no-<TABLE> plain-text body at blank lines (document_builder._add_text), so a bare SIGNATURE heading and the sentence Form 8-K's General Instructions prescribe arrive as one paragraph when the source has no blank line between them. Strategy 5c's _SIGNATURE_STATEMENT was anchored at ^Pursuant to, so it no longer matched and the last item ran on through the signature block. _SIGNATURE_STATEMENT now accepts an optional leading SIGNATURE(S) label before the prescribed sentence. Filing 0000710782-24-000002 (CIK 710782, filed 2024-02-05, Item 8.01, primary document 8k01.htm, one <pre> of 3,411 characters): before: Item 8.01 = 1,348 chars, SIGNATURE at offset 3,037 included after: Item 8.01 = 972 chars, ending "...global competitiveness." Regression test: tests/issues/regression/test_issue_1563.py (offline, fixture tests/fixtures/issues/0000710782-24-000002.html). * test(1563): parse the fixture once per module; trim changelog to behaviour dgunning's review noted the document was parsed three times and that the changelog bullet duplicated the root cause we keep in the PR and commit. The fixture is now module-scoped and the bullet states the behaviour only. No assertion or fixture content changes; 3 tests still pass. --------- Co-authored-by: Shivam Maurya <shivam@programmingwithmaurya.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-ups to #1531 under edgartools-llmp.12.1, plus edgartools-2f4l0.
Changes
<TABLE>. The wrapper<div>holds only text, so it built as oneParagraphNodeand fix(documents): build a plain-text filing's blank-line blocks as paragraphs (llmp.12.1) #1531's split never ran. A preformatted div with no child elements and a blank line now builds as a container.<PAGE>markers. The marker is never closed, so lxml nested the rest of the filing inside it. The parser now drops it from plain-text input.TextExtractor._extract_tableappended it again. An SGML<CAPTION>is never closed, so it holds the whole table and the table printed twice. The extractor now adds the caption only when the rendered table doesn't already open with it.Measured
<PAGE>filings render the same words, with paragraph breaks restored.Verification
Locally:
🤖 Generated with Claude Code