Skip to content

Transforms complex documents like PDFs and Office docs into LLM-ready markdown/JSON for your Agentic workflows.

feat: improve text block merging by ensuring both blocks have lines before merging

myhloli6ced3dd6f151
diff --git a/mineru/backend/pipeline/para_split.py b/mineru/backend/pipeline/para_split.py
index afc67912..c1b276a2 100644
--- a/mineru/backend/pipeline/para_split.py
+++ b/mineru/backend/pipeline/para_split.py
@@ -260,7 +260,7 @@ def __is_list_or_index_block(block):
def __merge_2_text_blocks(block1, block2):
- if len(block1['lines']) > 0:
+ if len(block1['lines']) > 0 and len(block2['lines']) > 0:
first_line = block1['lines'][0]
line_height = first_line['bbox'][3] - first_line['bbox'][1]
block1_weight = block1['bbox'][2] - block1['bbox'][0]