Skip to content

Commit 56b5a88

Browse files
authored
Merge pull request #32 from Filimoa/29
#29 [minor tweak to mashihua's branch]
2 parents 6d6f1df + 64283d0 commit 56b5a88

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ name = "openparse"
77
description = "Streamlines the process of preparing documents for LLM's."
88
readme = "README.md"
99
requires-python = ">=3.8"
10-
version = "0.5.3"
10+
version = "0.5.4"
1111
authors = [{name = "Sergey Filimonov", email = "[email protected]"}]
1212
dependencies = [
1313
"PyMuPDF >= 1.23.2",

src/openparse/tables/pymupdf/parse.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,19 @@ def output_to_html(headers: List[str], rows: List[List[str]]) -> str:
2222

2323

2424
def output_to_markdown(headers: List[str], rows: List[List[str]]) -> str:
25-
markdown_output = "| " + " | ".join(headers) + " |\n"
25+
markdown_output = ""
26+
if headers is not None:
27+
for header in headers:
28+
safe_header = "" if header is None else header
29+
markdown_output += "| " + safe_header + " "
30+
31+
markdown_output += "|\n"
2632
markdown_output += "|---" * len(headers) + "|\n"
2733

2834
for row in rows:
29-
processed_row = [" " if cell in [None, ""] else cell.replace("\n", " ") for cell in row]
35+
processed_row = [
36+
" " if cell in [None, ""] else cell.replace("\n", " ") for cell in row
37+
]
3038
markdown_output += "| " + " | ".join(processed_row) + " |\n"
3139

3240
return markdown_output

src/openparse/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
OPEN_PARSE_VERSION = "0.5.3"
1+
OPEN_PARSE_VERSION = "0.5.4"
22

33

44
def version_info() -> str:

0 commit comments

Comments
 (0)