Fix pipe characters in HTML table cells - #2441
Fix pipe characters in HTML table cells#2441Aakash Neupane (akkinyu2002) wants to merge 1 commit into
Conversation
|
Aakash Neupane (@akkinyu2002) please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
1 similar comment
|
Aakash Neupane (@akkinyu2002) please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
There was a problem hiding this comment.
🟡 Changes recommended
Literal backslash runs before pipes can still leave Markdown table delimiters unescaped.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Fixes literal pipe handling in HTML table cells to preserve Markdown table structure.
Changes:
- Escapes pipes in HTML table cells.
- Adds regression coverage.
File summaries
| File | Summary |
|---|---|
packages/markitdown/tests/test_html_converter.py |
Adds regression tests for pipes in HTML tables. |
packages/markitdown/src/markitdown/converters/_markdownify.py |
Implements table-cell pipe escaping. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
|
||
| @staticmethod | ||
| def _escape_table_cell_pipes(text: str) -> str: | ||
| return re.sub(r"(?<!\\)\|", r"\|", text) |
Summary
Validation
Fixes #2438