A fast, helpful, and open-source document parser
fix: keep multi-line table headers within the same x pos
Logan Markewich56ccc9287e48
diff --git a/crates/liteparse-napi/Cargo.toml b/crates/liteparse-napi/Cargo.tomlindex a40efd2..77e20ff 100644--- a/crates/liteparse-napi/Cargo.toml+++ b/crates/liteparse-napi/Cargo.toml@@ -1,6 +1,6 @@[package]name = "liteparse-napi"-version = "2.13.0"+version = "2.13.1"edition.workspace = truelicense.workspace = truerepository.workspace = true@@ -14,7 +14,7 @@ default = ["tesseract"]tesseract = ["liteparse/tesseract"][dependencies]-liteparse = { package = "liteparse", version = "2.13.0", path = "../liteparse", default-features = false }+liteparse = { package = "liteparse", version = "2.13.1", path = "../liteparse", default-features = false }pdfium-sys = { package = "liteparse-pdfium-sys", version = "1.5.0", path = "../pdfium-sys" }napi = { version = "2", features = ["async", "serde-json", "napi9"] }napi-derive = "2"diff --git a/crates/liteparse-python/Cargo.toml b/crates/liteparse-python/Cargo.tomlindex d20a320..f664931 100644--- a/crates/liteparse-python/Cargo.toml+++ b/crates/liteparse-python/Cargo.toml@@ -1,6 +1,6 @@[package]name = "liteparse-python"-version = "2.13.0"+version = "2.13.1"edition.workspace = truelicense.workspace = truerepository.workspace = true@@ -15,7 +15,7 @@ default = ["tesseract"]tesseract = ["liteparse/tesseract"][dependencies]-liteparse = { package = "liteparse", version = "2.13.0", path = "../liteparse", default-features = false }+liteparse = { package = "liteparse", version = "2.13.1", path = "../liteparse", default-features = false }pdfium-sys = { package = "liteparse-pdfium-sys", version = "1.5.0", path = "../pdfium-sys" }pdfium = { package = "liteparse-pdfium", version = "1.5.0", path = "../pdfium" }clap = { version = "4.5.55", features = ["derive"] }diff --git a/crates/liteparse-wasm/Cargo.toml b/crates/liteparse-wasm/Cargo.tomlindex 8f3da44..720b39b 100644--- a/crates/liteparse-wasm/Cargo.toml+++ b/crates/liteparse-wasm/Cargo.toml@@ -1,6 +1,6 @@[package]name = "liteparse-wasm"-version = "2.13.0"+version = "2.13.1"edition.workspace = truelicense.workspace = truerepository.workspace = truediff --git a/crates/liteparse/Cargo.toml b/crates/liteparse/Cargo.tomlindex efb9263..6df66e2 100644--- a/crates/liteparse/Cargo.toml+++ b/crates/liteparse/Cargo.toml@@ -1,6 +1,6 @@[package]name = "liteparse"-version = "2.13.0"+version = "2.13.1"edition.workspace = truelicense.workspace = truerepository.workspace = truediff --git a/crates/liteparse/src/markdown_layout/tables.rs b/crates/liteparse/src/markdown_layout/tables.rsindex fe197e2..8bf3fc3 100644--- a/crates/liteparse/src/markdown_layout/tables.rs+++ b/crates/liteparse/src/markdown_layout/tables.rs@@ -1359,7 +1359,20 @@ fn try_detect_table(lines: &[ProjectedLine], start_idx: usize, floor: usize) ->.filter(|c| match_track_idx(c, &track_ranges).is_some()).cloned().collect();- if kept.len() == column_count {+ // Only cells sitting entirely outside the table's x-extent can be+ // foreign page-column bleed. A cell that lands *between* two+ // established tracks is in-table content, so discarding it would+ // silently lose document text — break the run instead and let the+ // wider row seed its own table.+ let first_track_x = track_ranges+ .first()+ .map(|r| r.0)+ .unwrap_or(f32::NEG_INFINITY);+ let extras_all_outside = cells+ .iter()+ .filter(|c| match_track_idx(c, &track_ranges).is_none())+ .all(|c| c.end_x < first_track_x || c.start_x > tracks_right_edge);+ if kept.len() == column_count && extras_all_outside {cells = kept;} else {break;diff --git a/packages/node/package.json b/packages/node/package.jsonindex 2e71be4..7a28dc6 100644--- a/packages/node/package.json+++ b/packages/node/package.json@@ -1,6 +1,6 @@{"name": "@llamaindex/liteparse",- "version": "2.13.0",+ "version": "2.13.1","description": "Fast, lightweight PDF and document parsing with spatial text extraction","type": "module","main": "./dist/lib.js",@@ -54,13 +54,13 @@"typescript": "~5.9.2"},"optionalDependencies": {- "@llamaindex/liteparse-darwin-arm64": "2.13.0",- "@llamaindex/liteparse-darwin-x64": "2.13.0",- "@llamaindex/liteparse-linux-arm64-gnu": "2.13.0",- "@llamaindex/liteparse-linux-x64-gnu": "2.13.0",- "@llamaindex/liteparse-win32-arm64-msvc": "2.13.0",- "@llamaindex/liteparse-win32-x64-msvc": "2.13.0",- "@llamaindex/liteparse-linux-x64-musl": "2.13.0"+ "@llamaindex/liteparse-darwin-arm64": "2.13.1",+ "@llamaindex/liteparse-darwin-x64": "2.13.1",+ "@llamaindex/liteparse-linux-arm64-gnu": "2.13.1",+ "@llamaindex/liteparse-linux-x64-gnu": "2.13.1",+ "@llamaindex/liteparse-win32-arm64-msvc": "2.13.1",+ "@llamaindex/liteparse-win32-x64-msvc": "2.13.1",+ "@llamaindex/liteparse-linux-x64-musl": "2.13.1"},"engines": {"node": ">=18.0.0"diff --git a/packages/python/pyproject.toml b/packages/python/pyproject.tomlindex d34aea1..c43f0bc 100644--- a/packages/python/pyproject.toml+++ b/packages/python/pyproject.toml@@ -4,7 +4,7 @@ build-backend = "maturin"[project]name = "liteparse"-version = "2.13.0"+version = "2.13.1"description = "Python bindings for LiteParse - fast, lightweight PDF and document parsing"readme = "README.md"license = "Apache-2.0"diff --git a/packages/wasm/package.json b/packages/wasm/package.jsonindex cbec022..5b67ad1 100644--- a/packages/wasm/package.json+++ b/packages/wasm/package.json@@ -1,6 +1,6 @@{"name": "@llamaindex/liteparse-wasm",- "version": "2.13.0",+ "version": "2.13.1","description": "Fast, lightweight PDF parsing with spatial text extraction — WebAssembly build for browsers","type": "module","main": "./pkg/liteparse_wasm.js",