#465·liteparse

[Parsing] Markdown formatter inserts a space between contiguous text runs, splitting decimals ("7.7" -> "7 .7")

Author: PAAG-EbicysCreated Sep 19, 2026Updated Sep 26, 2026

Description

When a PDF encodes a number as two adjacent text runs with a zero-width gap (e.g. 7 and .7), the native Markdown output (outputFormat: "markdown", no OCR) joins them with a space: 7 .7. The page's textItems show the two runs are contiguous (left.x + left.width == right.x), so the space is introduced by the Markdown formatter, not present in the PDF. In dense statistical tables this turns every affected decimal into two tokens, so it stops matching any downstream search or typed cast.

Observed on 2.10.1 (node, linux-x64-gnu); also reproduced earlier on 2.8.0 and 2.11.1.

Document

Page 35 of the UNDP report Human Development Indices and Indicators: 2018 Statistical Update (public document, statistical table 1). The single-page extract (38 KB) is attached to this issue as Human-Development-Indices-and-Indicators_p35.pdf.

A second, unrelated document (a bank annual report page where the integer part is set in a larger font than the fraction) yields 3 .51 and 1 .29% with the same zero-gap pattern, so this is not specific to one producer.

Expected Output

Runs whose horizontal gap is below a small fraction of the line height (say <= 0.15 x height) should be concatenated without a separator; a space should only be emitted for a real inter-word gap. For the Mali row:

| 182 Mali | 0.427 | 58.5 | 7.7 | 2.3 f | 1,953 | -16 | 181 |

Actual Output

| 182 Mali | 0.427 | 58.5 | 7 .7 | 2.3 f | 1,953 | -16 | 181 |

The same page yields 11 .7, 7 .2 and 11 .9 (twice). The textItems for that row (x, x+width, rounded):

["182", 46.7, 56.0]  ["Mali", 60.0, 71.7]  ["0.427", 194.0, 208.0]  ["58.5", 252.7, 263.6]
["7", 313.4, 316.5]  [".7", 316.5, 321.2]  ["2.3 f", 370.9, 381.5] ...

7 ends at x=316.5 and .7 starts at x=316.5 (gap 0.0, line height 8.4).

Additional note: in outputFormat: "json" the plain text field for the same row reads 58.5 .7, i.e. the leading 7 run is not rendered at all in the plain-text projection, so that layer loses the digit rather than splitting it.

Command Used

javascript
import { LiteParse } from "@llamaindex/liteparse";
const parser = new LiteParse({ outputFormat: "markdown", imageMode: "placeholder", ocrEnabled: false });
const res = await parser.parse("Human-Development-Indices-and-Indicators_p35.pdf");
const page = res.pages[0];
console.log(page.markdown.split("\n").find((l) => l.includes("Mali")));
const row = page.textItems.filter((i) => Math.abs(i.y - 149.8) < 1).sort((a, b) => a.x - b.x);
console.log(row.map((i) => [i.text, +i.x.toFixed(1), +(i.x + i.width).toFixed(1)]));

LiteParse Version

@llamaindex/liteparse 2.10.1 (Node 22.22.3, linux-x64-gnu, inside Docker)

Operating System

Linux (x64, Docker); also seen on Windows 10 host.

Workaround we apply

Post-process each page's Markdown with the page's own textItems: find contiguous pairs on the same line where the left run ends in a digit and the right run starts with a decimal separator followed by a digit (or the mirror), with gap <= 0.15 x line height, and remove the single space between those two strings. Happy to send it as a reference if useful.