Skip to content

Commit 64283d0

Browse files
committed
fixed minor formatting issues
1 parent f1b16d8 commit 64283d0

3 files changed

Lines changed: 11 additions & 6 deletions

File tree

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 = "hello@sergey.fyi"}]
1212
dependencies = [
1313
"PyMuPDF >= 1.23.2",

src/openparse/tables/pymupdf/parse.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,18 @@ def output_to_html(headers: List[str], rows: List[List[str]]) -> str:
2323

2424
def output_to_markdown(headers: List[str], rows: List[List[str]]) -> str:
2525
markdown_output = ""
26-
for header in headers:
27-
markdown_output += "|" + (header or "")
28-
markdown_output += " |\n"
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"
2932
markdown_output += "|---" * len(headers) + "|\n"
3033

3134
for row in rows:
32-
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+
]
3338
markdown_output += "| " + " | ".join(processed_row) + " |\n"
3439

3540
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)