Skip to content

✨ Add --enable-tables to the CLI, and fix interactive-mode line joining - #425

Merged
chrisjsewell merged 2 commits into
masterfrom
claude/pr-422
Sep 9, 2026
Merged

✨ Add --enable-tables to the CLI, and fix interactive-mode line joining#425
chrisjsewell merged 2 commits into
masterfrom
claude/pr-422

Conversation

@chrisjsewell

@chrisjsewell chrisjsewell commented Sep 9, 2026

Copy link
Copy Markdown
Member

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 Hard line breaks parsed incorrectly in version 1.1.0 #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 ✨ NEW: Add --enable-tables to the CLI #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.

jf nz and others added 2 commits September 9, 2026 12:00
Joining interactive input with "".join, rather than "\n".join, also fixes
issue #172: every input line already ends in a newline, so the old join
doubled them, splitting each line into its own paragraph and breaking
hard line breaks. Record this in the changelog and add a regression test.
@chrisjsewell
chrisjsewell merged commit c02f6b1 into master Sep 9, 2026
13 checks passed
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? 😢 Hard line breaks parsed incorrectly in version 1.1.0

1 participant