v1.1.0: Fix stdin mode, handle escaped pipes, add --version and tests - #1
Merged
Merged
Conversation
Changes: - BUG FIX: Stdin mode now works (empty args = read stdin, not show help) - BUG FIX: Escaped pipes (\|) in table cells now parse correctly - FEATURE: --version flag shows version (v1.1.0) - FEATURE: 20-test Python test suite with no dependencies - REFACTOR: Split into mdtable.py (logic) + mdtable (wrapper entry point) - Added .gitignore All 20 tests pass: parsing, alignment, formatting, file mode, round-trip stability.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Three bug fixes, one feature, and a proper test suite for mdtable.
Bug Fixes
Stdin mode broken —
mdtable < fileorcat file | mdtableshowed help instead of processing input. Empty args now correctly reads from stdin. This was the main interactive workflow documented in the README and it didn't work!Escaped pipes break cell parsing — Running mdtable on markdown with escaped pipes inside cells (common in grep/sed patterns, code examples) would split on the escaped pipe. Now handles escaped pipes as literal pipe characters.
Features
--version flag — Shows
mdtable v1.1.0. Useful for CI scripts and reporting.Test suite —
tests.pywith 20 tests covering: cell parsing (including escaped pipes), alignment detection (left/right/center), table parsing, formatting, multi-table documents, round-trip stability, and file mode integration. Zero dependencies — justpython3 tests.py.Refactoring
mdtable.py(importable module) +mdtable(thin wrapper entry point)./mdtableandpython3 mdtable.pywork identically.gitignoreVerification
All 20 tests pass. Ready for review, Froggy! Ribbit!