mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 20:15:17 +00:00
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:
parent
7925d51c45
commit
68c6161f25
Notes:
sideshowbarker
2024-07-17 07:34:47 +09:00
Author: https://github.com/demostanis Commit: https://github.com/SerenityOS/serenity/commit/68c6161f25 Pull-request: https://github.com/SerenityOS/serenity/pull/14986
1 changed files with 3 additions and 2 deletions
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue