Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def convert(
md_content = ""
for s in sheets:
md_content += f"## {s}\n"
html_content = sheets[s].to_html(index=False)
html_content = sheets[s].to_html(index=False, na_rep="")
md_content += (
self._html_converter.convert_string(
html_content, **kwargs
Expand Down Expand Up @@ -146,7 +146,7 @@ def convert(
md_content = ""
for s in sheets:
md_content += f"## {s}\n"
html_content = sheets[s].to_html(index=False)
html_content = sheets[s].to_html(index=False, na_rep="")
md_content += (
self._html_converter.convert_string(
html_content, **kwargs
Expand Down
Binary file not shown.
11 changes: 11 additions & 0 deletions packages/markitdown/tests/test_module_misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,17 @@ def test_exceptions() -> None:
assert type(exc_info.value.attempts[0].converter).__name__ == "PptxConverter"


def test_xlsx_blank_cells() -> None:
# Blank cells in .xlsx should render as empty strings, not "NaN"
markitdown = MarkItDown()
result = markitdown.convert(
os.path.join(TEST_FILES_DIR, "test_xlsx_blank_cells.xlsx")
)
assert "NaN" not in result.markdown
assert "Alice" in result.markdown
assert "Bob" in result.markdown


@pytest.mark.skipif(
skip_exiftool,
reason="do not run if exiftool is not installed",
Expand Down
Loading