diff options
author | demostanis <demostanis@protonmail.com> | 2022-08-23 14:41:14 +0200 |
---|---|---|
committer | Brian Gianforcaro <b.gianfo@gmail.com> | 2022-09-01 23:36:23 +0000 |
commit | 68c6161f250ae7c6cca8165ccd8a77f5426cbc05 (patch) | |
tree | b4a232b79f9b4808d2064902a92cfabd254bb7bf /Userland | |
parent | 7925d51c451d6db053ef10d099f53f9deeaa108e (diff) | |
download | serenity-68c6161f250ae7c6cca8165ccd8a77f5426cbc05.zip |
LibMarkdown: Add newline and remove ANSI escape after code blocks
Also make clang-tidy happy by making line a const&
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/Libraries/LibMarkdown/CodeBlock.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Userland/Libraries/LibMarkdown/CodeBlock.cpp b/Userland/Libraries/LibMarkdown/CodeBlock.cpp index 87a82b24bb..94d6d05f01 100644 --- a/Userland/Libraries/LibMarkdown/CodeBlock.cpp +++ b/Userland/Libraries/LibMarkdown/CodeBlock.cpp @@ -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(); } |