✨ NEW: Add --enable-tables to the CLI - #422
Closed
user01010111 wants to merge 1 commit into
Closed
Conversation
chrisjsewell
added a commit
that referenced
this pull request
Sep 9, 2026
…ning (#425) ## Summary Supersedes #422 by @user01010111, whose fork does not allow maintainer pushes; their commit is carried here verbatim with authorship preserved (thank you!). Closes #352 and closes #172. - Adds `--enable-tables` to the `markdown-it` CLI for file, stdin and interactive input, by threading one `MarkdownIt` instance through every route (each function keeps an `md=None` default, so existing callers are unaffected). - Also fixes the interactive mode's line joining, the root cause of #172 (five years old): each input line already ends in `"\n"`, so the old `"\n".join(contents)` doubled every newline, split every line into its own paragraph and broke hard line breaks. Now `"".join`. This change was in #422 but not called out there; this PR adds a changelog line and a regression test for it. ## Commits 1. `✨ NEW: Add --enable-tables to the CLI` — the contributor's commit, unchanged. 2. `🐛 FIX: Note and test interactive-mode line joining fix (#172)` — changelog entries and `test_interactive_hard_line_break`, which drives `interactive()` with patched `input` and asserts `foo\` + `bar` renders as one paragraph with `<br />`. ## Verification - 1000 tests pass (+7 over master), all pre-commit hooks pass under the new ruff 0.16 / mypy 2.3 pins. - Local docs build adds no warnings over master. - Smoke-checked: `--help` matches the README block, `--enable-tables --stdin` renders a `<table>`, and without the flag the same input stays a paragraph. --------- Co-authored-by: jf nz <talon_usable_9k@icloud.com>
Member
|
Thanks @user01010111! Your commit has been merged verbatim, with your authorship preserved, via #425 (we could not push to this fork branch to bring it up to date). #425 also added a changelog line and a regression test for the interactive-mode line-joining fix that was part of this change, which turned out to be the root cause of the five-year-old #172. Closing this in favour of #425; it will be in the next release. |
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.
Closes #352.
Add
--enable-tablesfor files, standard input and interactive input, usingMarkdownIt.enable("table"). Default CommonMark rules and HTML settings remain unchanged.Pass the configured parser through each CLI route and preserve interactive input line breaks so tables can be entered line by line. Update the CLI help, README and changelog.
Validation: 987 tests passed on Python 3.13, including default/opt-in checks across all CLI routes; all pre-commit hooks passed. Source distribution and wheel builds passed, with file/stdin checks against the installed command. Strict docs passed on Python 3.10 with Sphinx 8.1.3. Newer Sphinx versions hit the existing
apidoc.OPTIONSincompatibility.