ソースを参照

LibMarkdown: Indent blockquotes inside the terminal renderer

This removes one FIXME :^)
Arda Cinar 2 年 前
コミット
c9d434247d
1 ファイル変更6 行追加2 行削除
  1. 6 2
      Userland/Libraries/LibMarkdown/BlockQuote.cpp

+ 6 - 2
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