From bed5a752dff156ef7ba99769c7b88daf0a2dd2bf Mon Sep 17 00:00:00 2001 From: ronak69 Date: Fri, 4 Aug 2023 04:45:46 +0000 Subject: [PATCH] LibMarkdown: Preserve blank lines in `CodeBlock`s Specifically, `CodeBlock::render_lines_for_terminal()` eats up blank lines because it uses `DeprecatedString::split()` without the `SplitBehavior::KeepEmpty` enum. Easy fix: use the enum. --- Userland/Libraries/LibMarkdown/CodeBlock.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Userland/Libraries/LibMarkdown/CodeBlock.cpp b/Userland/Libraries/LibMarkdown/CodeBlock.cpp index 1d388fabca..71eb00c03b 100644 --- a/Userland/Libraries/LibMarkdown/CodeBlock.cpp +++ b/Userland/Libraries/LibMarkdown/CodeBlock.cpp @@ -66,9 +66,8 @@ Vector CodeBlock::render_lines_for_terminal(size_t) const indentation = " "sv; } - for (auto const& line : m_code.split('\n')) + for (auto const& line : m_code.split('\n', SplitBehavior::KeepEmpty)) lines.append(DeprecatedString::formatted("{}{}", indentation, line)); - lines.append(""); return lines; }