mirror of
https://github.com/SerenityOS/serenity
synced 2024-09-06 17:06:31 +00:00
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.
This commit is contained in:
parent
e0e027c17c
commit
bed5a752df
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue