✨ Add --enable-tables to the CLI, and fix interactive-mode line joining - #425
Merged
Conversation
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.
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
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.
--enable-tablesto themarkdown-itCLI for file, stdin and interactive input, by threading oneMarkdownItinstance through every route (each function keeps anmd=Nonedefault, so existing callers are unaffected)."\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
✨ NEW: Add --enable-tables to the CLI— the contributor's commit, unchanged.🐛 FIX: Note and test interactive-mode line joining fix (#172)— changelog entries andtest_interactive_hard_line_break, which drivesinteractive()with patchedinputand assertsfoo\+barrenders as one paragraph with<br />.Verification
--helpmatches the README block,--enable-tables --stdinrenders a<table>, and without the flag the same input stays a paragraph.