XLSX/XLS: pipe characters in cells break Markdown tables
Author: soroush5Created Sep 10, 2026Updated Sep 10, 2026
A literal | in an Excel cell value or header is data, not a column separator, but it is emitted raw, so converted rows gain phantom columns and the Markdown table is corrupt.
Repro (markitdown[xlsx], current main):
import io
import pandas as pd
from markitdown import MarkItDown
buf = io.BytesIO()
with pd.ExcelWriter(buf, engine="openpyxl") as w:
pd.DataFrame({"a": ["x|y"], "b": ["2"]}).to_excel(w, index=False)
print(MarkItDown().convert_stream(buf.getvalue(), file_extension=".xlsx").markdown)
Actual (2-column table, 3-column row):
## Sheet1
| a | b |
| --- | --- |
| x|y | 2 |
Expected: | x\|y | 2 |, the same escaping the CSV converter already applies (see #2019 / #2266). Same problem in the .xls converter.
Source: microsoft/markitdown