You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug: consecutive partial numbers (.1 followed by .2) wrongly merged into '.1 .2' #2114
In _merge_partial_numbering_lines() (_pdf_converter.py), when two partial MasterFormat-style numbers appear on consecutive lines, the function merges the first number with the second number instead of merging it with the actual text below.
Reproduction
`python
from markitdown.converters._pdf_converter import _merge_partial_numbering_lines
text = '.1\n.2\nContractor shall furnish all materials.\n.3\nWork shall comply with local codes.'
print(_merge_partial_numbering_lines(text))
`
Actual output: .1 .2 Contractor shall furnish all materials. .3 Work shall comply with local codes.
Expected output: .1 .2 Contractor shall furnish all materials. .3 Work shall comply with local codes.
Root cause
Line 47 in _pdf_converter.py merges the current partial number with the next non-empty line unconditionally — it never checks if that next line is itself a partial number.
Fix
Add one guard before merging: python if j < len(lines) and not PARTIAL_NUMBERING_PATTERN.match(lines[j].strip()):
Activity