summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibMarkdown
diff options
context:
space:
mode:
authorArda Cinar <kuzux92@gmail.com>2022-12-23 12:32:27 +0300
committerAndreas Kling <kling@serenityos.org>2022-12-31 00:09:23 +0100
commitc9d434247dffe85ec69b05dbc57ffe17a64959c7 (patch)
tree1f36c9997290c728b609601636d75306dd9983e2 /Userland/Libraries/LibMarkdown
parent5cc984d74c9453fa71ea8bb2d600d5bdb9135fb4 (diff)
downloadserenity-c9d434247dffe85ec69b05dbc57ffe17a64959c7.zip
LibMarkdown: Indent blockquotes inside the terminal renderer
This removes one FIXME :^)
Diffstat (limited to 'Userland/Libraries/LibMarkdown')
-rw-r--r--Userland/Libraries/LibMarkdown/BlockQuote.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/Userland/Libraries/LibMarkdown/BlockQuote.cpp b/Userland/Libraries/LibMarkdown/BlockQuote.cpp
index 6b91db1758..191f7a96a6 100644
--- a/Userland/Libraries/LibMarkdown/BlockQuote.cpp
+++ b/Userland/Libraries/LibMarkdown/BlockQuote.cpp
@@ -22,8 +22,12 @@ DeprecatedString BlockQuote::render_to_html(bool) const
Vector<DeprecatedString> BlockQuote::render_lines_for_terminal(size_t view_width) const
{
- // FIXME: Indent lines inside the blockquote
- return m_contents->render_lines_for_terminal(view_width);
+ Vector<DeprecatedString> lines;
+ size_t child_width = view_width < 4 ? 0 : view_width - 4;
+ for (auto& line : m_contents->render_lines_for_terminal(child_width))
+ lines.append(DeprecatedString::formatted(" {}", line));
+
+ return lines;
}
RecursionDecision BlockQuote::walk(Visitor& visitor) const