Skip to content

fix: unify markdown/html export code path, add tests and CLI choices#63

Merged
mpryor merged 1 commit into
mainfrom
fix/markdown-html-export-followup
May 8, 2026
Merged

fix: unify markdown/html export code path, add tests and CLI choices#63
mpryor merged 1 commit into
mainfrom
fix/markdown-html-export-followup

Conversation

@mpryor
Copy link
Copy Markdown
Owner

@mpryor mpryor commented May 8, 2026

Summary

Follow-up to #62 addressing gaps found during review.

  • batch.py: --no-tui --output-format markdown/html silently fell through to CSV — batch had its own _write_output that didn't know about the new formats. Fixed by extracting write_rows_to_fd() from operations.py as the single shared implementation for all format logic, and having both write_buffer_to_fd and batch delegate to it. Removed _write_output entirely.
  • cli.py: Added markdown and html to --output-format choices (they were missing, so argparse would reject them).
  • Tests: Added _infer_output_format assertions for .md/.markdown/.html, plus test_write_markdown_output and test_write_html_output async round-trip tests, and CLI flag tests.
  • Bonus: the pipe-spacing bug in raw markdown output (age| with no leading space) is fixed as a side-effect of the refactor.

@mpryor mpryor merged commit 2899af3 into main May 8, 2026
1 check passed
@mpryor mpryor deleted the fix/markdown-html-export-followup branch May 8, 2026 02:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant