From f1b16d8bd5b33a1d19e383602e59dbb62f33fc18 Mon Sep 17 00:00:00 2001 From: Shihua Ma Date: Tue, 23 Apr 2024 10:02:17 +0800 Subject: [PATCH] Update parse.py Fix bug with https://github.com/Filimoa/open-parse/issues/28 --- src/openparse/tables/pymupdf/parse.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/openparse/tables/pymupdf/parse.py b/src/openparse/tables/pymupdf/parse.py index b8699bf..5b11f3d 100644 --- a/src/openparse/tables/pymupdf/parse.py +++ b/src/openparse/tables/pymupdf/parse.py @@ -22,7 +22,10 @@ def output_to_html(headers: List[str], rows: List[List[str]]) -> str: def output_to_markdown(headers: List[str], rows: List[List[str]]) -> str: - markdown_output = "| " + " | ".join(headers) + " |\n" + markdown_output = "" + for header in headers: + markdown_output += "|" + (header or "") + markdown_output += " |\n" markdown_output += "|---" * len(headers) + "|\n" for row in rows: