diff options
author | Arda Cinar <kuzux92@gmail.com> | 2022-12-23 12:25:00 +0300 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-12-31 00:09:23 +0100 |
commit | 5cc984d74c9453fa71ea8bb2d600d5bdb9135fb4 (patch) | |
tree | d56ae55d1d3215abfab5c4da6fff92017490828f /Userland/Libraries/LibMarkdown/CodeBlock.h | |
parent | 7a4b912ece600ac94a9e2c5b9991475fbd0c20fd (diff) | |
download | serenity-5cc984d74c9453fa71ea8bb2d600d5bdb9135fb4.zip |
LibMarkdown: Render lines to terminal instead of a single string
With this patch, the blocks in a markdown document render a vector of
lines. These lines get concatenated in Document::render_to_terminal, so
this does not change any external APIs of LibMarkdown.
This change makes it possible to indent individual lines in the rendered
markdown. So, rendering blockquotes in a similar way to code blocks :^)
Diffstat (limited to 'Userland/Libraries/LibMarkdown/CodeBlock.h')
-rw-r--r-- | Userland/Libraries/LibMarkdown/CodeBlock.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibMarkdown/CodeBlock.h b/Userland/Libraries/LibMarkdown/CodeBlock.h index 4ac55cc1bd..1163cf252e 100644 --- a/Userland/Libraries/LibMarkdown/CodeBlock.h +++ b/Userland/Libraries/LibMarkdown/CodeBlock.h @@ -27,7 +27,7 @@ public: virtual ~CodeBlock() override = default; virtual DeprecatedString render_to_html(bool tight = false) const override; - virtual DeprecatedString render_for_terminal(size_t view_width = 0) const override; + virtual Vector<DeprecatedString> render_lines_for_terminal(size_t view_width = 0) const override; virtual RecursionDecision walk(Visitor&) const override; static OwnPtr<CodeBlock> parse(LineIterator& lines, Heading* current_section); |