Skip to content

✨ NEW: Add --enable-tables to the CLI - #422

Closed
user01010111 wants to merge 1 commit into
executablebooks:masterfrom
user01010111:feat/cli-enable-tables
Closed

✨ NEW: Add --enable-tables to the CLI#422
user01010111 wants to merge 1 commit into
executablebooks:masterfrom
user01010111:feat/cli-enable-tables

Conversation

@user01010111

Copy link
Copy Markdown
Contributor

Closes #352.

Add --enable-tables for files, standard input and interactive input, using MarkdownIt.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.OPTIONS incompatibility.

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>

chrisjsewell commented Sep 9, 2026

Copy link
Copy Markdown
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.

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.

[3.0.0] Command markdown-it does not allow activating support for tables? 😢

2 participants