markitdown icon indicating copy to clipboard operation
markitdown copied to clipboard

Escape CSV cells in Markdown tables

Open FU-max-boop opened this issue 6 months ago • 1 comments

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

FU-max-boop avatar May 11 '26 03:05 FU-max-boop

@microsoft-github-policy-service agree

FU-max-boop avatar May 11 '26 08:05 FU-max-boop