Blank cells in .xlsx would return NaN in the markdown.
This commit is contained in:
Simewu 2025-04-19 08:33:12 -04:00
parent 041be54471
commit 3e7f1cea19
No known key found for this signature in database
GPG key ID: EFCF40B33C56C712

View file

@ -84,7 +84,7 @@ class XlsxConverter(DocumentConverter):
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
@ -146,7 +146,7 @@ class XlsConverter(DocumentConverter):
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