LibMarkdown: Add newline and remove ANSI escape after code blocks

Also make clang-tidy happy by making line a const&
This commit is contained in:
demostanis 2022-08-23 14:41:14 +02:00 committed by Brian Gianforcaro
parent 7925d51c45
commit 68c6161f25
Notes: sideshowbarker 2024-07-17 07:34:47 +09:00

View file

@ -50,15 +50,16 @@ String CodeBlock::render_for_terminal(size_t) const
{
StringBuilder builder;
for (auto line : m_code.split('\n')) {
for (auto const& line : m_code.split('\n')) {
// Do not indent too much if we are in the synopsis
if (!(m_current_section && m_current_section->render_for_terminal().contains("SYNOPSIS"sv)))
builder.append(" "sv);
builder.append(" "sv);
builder.append(line);
builder.append("\x1b[0m\n"sv);
builder.append("\n"sv);
}
builder.append("\n"sv);
return builder.build();
}