diff options
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/Libraries/LibMarkdown/CodeBlock.cpp | 7 | ||||
-rw-r--r-- | Userland/Libraries/LibMarkdown/List.cpp | 5 | ||||
-rw-r--r-- | Userland/Libraries/LibMarkdown/Paragraph.cpp | 1 | ||||
-rw-r--r-- | Userland/Libraries/LibMarkdown/Table.cpp | 2 |
4 files changed, 10 insertions, 5 deletions
diff --git a/Userland/Libraries/LibMarkdown/CodeBlock.cpp b/Userland/Libraries/LibMarkdown/CodeBlock.cpp index 455045d9ad..77fc4e3140 100644 --- a/Userland/Libraries/LibMarkdown/CodeBlock.cpp +++ b/Userland/Libraries/LibMarkdown/CodeBlock.cpp @@ -49,8 +49,11 @@ String CodeBlock::render_for_terminal(size_t) const { StringBuilder builder; - builder.append(m_code); - builder.append("\n\n"); + for (auto line : m_code.split('\n')) { + builder.append(" "); + builder.append(line); + builder.append("\n"); + } return builder.build(); } diff --git a/Userland/Libraries/LibMarkdown/List.cpp b/Userland/Libraries/LibMarkdown/List.cpp index 0943234cc6..2ecd58401e 100644 --- a/Userland/Libraries/LibMarkdown/List.cpp +++ b/Userland/Libraries/LibMarkdown/List.cpp @@ -45,12 +45,11 @@ String List::render_for_terminal(size_t) const for (auto& item : m_items) { builder.append(" "); if (m_is_ordered) - builder.appendff("{}. ", ++i); + builder.appendff("{}.", ++i); else - builder.append("* "); + builder.append("*"); builder.append(item->render_for_terminal()); } - builder.append("\n"); return builder.build(); } diff --git a/Userland/Libraries/LibMarkdown/Paragraph.cpp b/Userland/Libraries/LibMarkdown/Paragraph.cpp index ab30bdd0bb..d1d2ebec65 100644 --- a/Userland/Libraries/LibMarkdown/Paragraph.cpp +++ b/Userland/Libraries/LibMarkdown/Paragraph.cpp @@ -30,6 +30,7 @@ String Paragraph::render_to_html(bool tight) const String Paragraph::render_for_terminal(size_t) const { StringBuilder builder; + builder.append(" "); builder.append(m_text.render_for_terminal()); builder.append("\n\n"); return builder.build(); diff --git a/Userland/Libraries/LibMarkdown/Table.cpp b/Userland/Libraries/LibMarkdown/Table.cpp index ff40867a88..445b969ea3 100644 --- a/Userland/Libraries/LibMarkdown/Table.cpp +++ b/Userland/Libraries/LibMarkdown/Table.cpp @@ -63,6 +63,8 @@ String Table::render_for_terminal(size_t view_width) const builder.append("\n"); } + builder.append("\n"); + return builder.to_string(); } |