fix(pdf): merge drop caps into the paragraph they open #5527
All Vouch review confidence checks passed
Residual risk 0.22 = Change Risk (0.39) × (1 − Review Confidence (0.43)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.39 · 249 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.330
Real PR Conversation Timeline
1 comments
"Review active on #5527"
general
weight: 0.35
github-actions[bot]
<!-- Thank you for contributing to Docling! -->
Issue resolved by this Pull Request:
Resolves #3883
A drop cap came out as its own one-letter block between paragraphs, or as "R ealized" when it sat in the paragraph's own cluster.
PageAssembleModelnow handles it on clusters before the elements are built. A drop cap is one uppercase-letter cell at least 2x the page's median line height (single-character cells are left out of that median). It only joins a line that starts lowercase, sits just right of it, has its top aligned with the drop cap's top and its baseline above the drop cap's baseline. A drop cap in its own cluster moves its cell into the target cluster and the bbox is widened. A drop cap already inside the cluster is joined to its word. Only TEXT, SECTION_HEADER and LIST_ITEM clusters are considered, so captions, footnotes, page furniture, code and formulas are never merged.Checklist:
Review evidence:
Before: a drop-cap "R" was exported as a standalone paragraph, or as "R ealized" when inside the cluster. After: both give "Realized through a combination of..." in one paragraph.
New
TestDropCaptests intests/test_page_assemble_model.pyuse synthetic clusters:Ran:
pytest tests/test_page_assemble_model.py -q -k DropCapfails before the change and passes afterpytest tests/test_page_assemble_model.py -qpassesruff checkandruff format --checkon the two changed files passNot run: the full test suite, and the
fuerea_digital_transformation_2026.pdffrom the issue. No reference data changed.