LibMarkdown: Preserve blank lines in CodeBlocks

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.
This commit is contained in:
ronak69 2023-08-04 04:45:46 +00:00 committed by Jelle Raaijmakers
parent e0e027c17c
commit bed5a752df

View file

@ -66,9 +66,8 @@ Vector<DeprecatedString> 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;
}