feat: remove colon exclusion from bold heading detection

The colon exclusion was preventing legitimate headings like "Steps for
Using the Microscope:" and "Changing objectives:" from being detected.
The single edge case it was protecting (chart sub-headers) is less
impactful than the many headings it was blocking.

Benchmark improvement: MHS 0.51→0.52, MHS-S 0.61→0.62.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Abimael Martell
2026-04-04 01:09:19 -07:00
co-authored by Claude Opus 4.6
parent 28823bd849
commit 103995c200
3 changed files with 10 additions and 10 deletions
+2 -8
View File
@@ -446,16 +446,10 @@ pub(super) fn to_markdown_from_lines_with_tables_and_images(
detect_header_level(line_font_size, base_size, &heading_tiers).or_else(|| {
// Bold-only lines at body font size that are standalone (paragraph break
// before them) are likely section headings. Require ≥3 words to avoid
// promoting short labels/field names. Exclude lines ending with colon
// (labels like "Table I:") or that are too short.
// promoting short labels/field names.
let all_bold = !line.items.is_empty() && line.items.iter().all(|i| i.is_bold);
let word_count = plain_trimmed.split_whitespace().count();
// Reject lines ending with colon (labels like "Table:") —
// strip trailing non-colon punctuation first (e.g. ":*" → ":")
let stripped =
plain_trimmed.trim_end_matches(|c: char| c != ':' && !c.is_alphanumeric());
let ends_with_colon = stripped.ends_with(':');
if all_bold && !in_paragraph && word_count >= 3 && !ends_with_colon {
if all_bold && !in_paragraph && word_count >= 3 {
Some(bold_heading_level(&heading_tiers))
} else {
None
+5 -1
View File
@@ -8,7 +8,11 @@ Department of the Treasury **Internal Revenue Service**
# and Report to Employer
**This publication contains:** **Form 4070A, Employees Daily Record of** Tips **Form 4070, Employees Report of Tips to** Employer
### This publication contains:
### Form 4070A, Employees Daily Record of
Tips **Form 4070, Employees Report of Tips to** Employer
For the period
+3 -1
View File
@@ -8,7 +8,9 @@
**Table I: Cap rate correlations**
**Cap Rate Correlation With:*** **BBB Corp** **10-Year Bond Yield S&P Dividend** **Treasury (10-15 yr) Yield** Multifamily 0.187 0.771 0.068 Industrial-0.221 0.748-0.307 CBD Office-0.449 0.694-0.458 Retail-0.181 0.649-02.58
## Cap Rate Correlation With:*
**BBB Corp** **10-Year Bond Yield S&P Dividend** **Treasury (10-15 yr) Yield** Multifamily 0.187 0.771 0.068 Industrial-0.221 0.748-0.307 CBD Office-0.449 0.694-0.458 Retail-0.181 0.649-02.58
* Based on 25 years of data for the 10-yrT & S&P DivYld; and 14 years for BBB.
**Figure 1:** NCREIF cap rates vs. 10-yearTreasury