diff --git a/src/markdown_exec/formatters/pycon.py b/src/markdown_exec/formatters/pycon.py index 5f5530e..d5037ca 100644 --- a/src/markdown_exec/formatters/pycon.py +++ b/src/markdown_exec/formatters/pycon.py @@ -2,8 +2,6 @@ from __future__ import annotations -import textwrap - from markupsafe import Markup from markdown_exec.formatters.base import base_format @@ -16,10 +14,10 @@ def _transform_source(code: str) -> tuple[str, str]: python_lines = [] for line in code.split("\n"): - if line.startswith(">>> "): + if line.startswith((">>> ", "... ")): python_lines.append(line[4:]) python_code = "\n".join(python_lines) - return python_code, textwrap.indent(python_code, ">>> ") + return python_code, code def _format_pycon(**kwargs) -> Markup: