Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 1 addition & 10 deletions markdown_it/cli/parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,11 @@ def convert_file(filename):
sys.exit('Cannot open file "{}".'.format(filename))


def interactive(import_readline=False):
def interactive():
"""
Parse user input, dump to stdout, rinse and repeat.
Python REPL style.
"""
if import_readline:
_import_readline()
print_heading()
contents = []
more = False
Expand Down Expand Up @@ -98,13 +96,6 @@ def parse_args(args):
return parser.parse_args(args)


def _import_readline():
try:
import readline # noqa: F401
except ImportError:
print("[warning] readline library not available.")


def print_heading():
print("{} (interactive)".format(version_str))
print("Type Ctrl-D to complete input, or Ctrl-C to exit.")
Expand Down
2 changes: 1 addition & 1 deletion tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ def mock_input(prompt):

with patch("builtins.print") as patched:
with patch("builtins.input", mock_input):
parse.interactive(import_readline=False)
parse.interactive()
patched.assert_called()