Skip to content
Open
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
4 changes: 3 additions & 1 deletion rich/markdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,9 @@ def __rich_console__(
lines = console.render_lines(self.elements, render_options, style=self.style)
style = self.style
new_line = Segment("\n")
padding = Segment("▌ ", style)
quote_bar = "| " if options.legacy_windows or options.ascii_only else "▌ "
padding = Segment(quote_bar, style)

for line in lines:
yield padding
yield from line
Expand Down
14 changes: 14 additions & 0 deletions tests/test_markdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,20 @@ def test_inline_code_in_table_cells() -> None:
assert result == expected


def test_markdown_blockquote_uses_safe_prefix_on_legacy_windows():
console = Console(
width=40,
file=io.StringIO(),
color_system=None,
legacy_windows=True,
_environ={},
)
console.print(Markdown("> hello"))
output = console.file.getvalue()
assert "| hello" in output
assert "▌" not in output


if __name__ == "__main__":
markdown = Markdown(MARKDOWN)
rendered = render(markdown)
Expand Down