From aeb44d3e012bdf6468644d5f62da4162e599cf1f Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 14 Mar 2023 13:40:30 -0500 Subject: [PATCH] fix handling of hardbreak (#2058) --- src/textual/widgets/_markdown.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/textual/widgets/_markdown.py b/src/textual/widgets/_markdown.py index 8e36b3e5e..1a9e1f041 100644 --- a/src/textual/widgets/_markdown.py +++ b/src/textual/widgets/_markdown.py @@ -639,7 +639,9 @@ class Markdown(Widget): for child in token.children: if child.type == "text": content.append(child.content, style_stack[-1]) - if child.type == "softbreak": + elif child.type == "hardbreak": + content.append("\n") + elif child.type == "softbreak": content.append(" ") elif child.type == "code_inline": content.append(