markitdown
markitdown copied to clipboard
Escape CSV cells in Markdown tables
Summary
- escape pipe characters in CSV cells before rendering Markdown tables
- normalize embedded newlines in CSV cells to
<br>so a quoted multiline field stays within one table row - add a focused regression test for pipe and multiline cell content
Tests
- uv run --project packages/markitdown --with pytest python -m pytest packages/markitdown/tests/test_module_misc.py::test_csv_converter_escapes_markdown_table_cells packages/markitdown/tests/test_module_vectors.py::test_convert_stream_with_hints -q
- uv run --project packages/markitdown --with ruff ruff format --check packages/markitdown/src/markitdown/converters/_csv_converter.py packages/markitdown/tests/test_module_misc.py
- uv run --project packages/markitdown --with ruff ruff check packages/markitdown/src/markitdown/converters/_csv_converter.py packages/markitdown/tests/test_module_misc.py
- uv run --project packages/markitdown --with mypy python -m mypy --ignore-missing-imports packages/markitdown/src/markitdown/converters/_csv_converter.py packages/markitdown/tests/test_module_misc.py
@microsoft-github-policy-service agree