HTML/DOCX: pipe characters in table cells break Markdown tables
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
Research direction
Start in the shared HTML layer, _CustomMarkdownify, and reproduce the supplied MarkItDown().convert_stream example to trace how table-cell text reaches Markdown. Done means literal pipes in HTML-derived table cells are escaped so the example renders two columns, with the same behavior preserved for DOCX tables that use the HTML converter.
Written by the indexing model from the issue text.
Description
A literal pipe in an HTML table cell is data, not a column separator, but it is passed through untouched, so the rendered row gains phantom columns. DOCX tables are affected too since they convert via the HTML converter.
Repro:
import io
from markitdown import MarkItDown
html = (
'<table><thead><tr><th>Name</th><th>Note</th></tr></thead>'
'<tbody><tr><td>Alice</td><td>Has a | pipe</td></tr></tbody></table>'
)
print(MarkItDown().convert_stream(
io.BytesIO(html.encode()), file_extension='.html').markdown)
# Before: | Alice | Has a | pipe | (3 columns, broken)
# After: | Alice | Has a \| pipe | (2 columns, correct)
Same class as the CSV (#2266) and XLSX (#2436) pipe bugs, but in the shared HTML layer (_CustomMarkdownify), which neither of those covers. Searched open and closed issues/PRs: no report or fix for HTML/DOCX table pipes (open #1785 covers PPTX only, via pre-escaping).
- Dominant language
- Python
- Stars
- 186k
- Forks
- 13.7k
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 49
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/markitdown
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
microsoft/markitdown#2530 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
microsoft/markitdown#2502 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
microsoft/markitdown#2481 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
microsoft/markitdown#2470 · 2 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
microsoft/markitdown#2398 ·
All issues in microsoft/markitdown
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100