2020-01-18 08:38:21 +00:00
|
|
|
/*
|
2020-01-24 13:45:29 +00:00
|
|
|
* Copyright (c) 2019-2020, Sergey Bugaev <bugaevc@serenityos.org>
|
2022-03-04 20:21:26 +00:00
|
|
|
* Copyright (c) 2022, the SerenityOS developers.
|
2020-01-18 08:38:21 +00:00
|
|
|
*
|
2021-04-22 08:24:48 +00:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-01-18 08:38:21 +00:00
|
|
|
*/
|
|
|
|
|
2019-09-20 21:46:18 +00:00
|
|
|
#pragma once
|
|
|
|
|
2020-05-18 20:58:00 +00:00
|
|
|
#include <AK/OwnPtr.h>
|
2020-04-28 19:04:25 +00:00
|
|
|
#include <LibMarkdown/Block.h>
|
|
|
|
#include <LibMarkdown/Text.h>
|
2019-09-20 21:46:18 +00:00
|
|
|
|
2020-04-28 19:04:25 +00:00
|
|
|
namespace Markdown {
|
|
|
|
|
|
|
|
class Paragraph final : public Block {
|
2019-09-20 21:46:18 +00:00
|
|
|
public:
|
2021-09-07 01:11:46 +00:00
|
|
|
Paragraph(Text text)
|
|
|
|
: m_text(move(text))
|
2020-09-18 07:49:51 +00:00
|
|
|
{
|
|
|
|
}
|
2020-09-20 16:12:23 +00:00
|
|
|
|
2022-03-04 20:21:26 +00:00
|
|
|
virtual ~Paragraph() override = default;
|
2019-09-20 21:46:18 +00:00
|
|
|
|
2022-12-04 18:02:33 +00:00
|
|
|
virtual DeprecatedString render_to_html(bool tight = false) const override;
|
2022-12-23 09:25:00 +00:00
|
|
|
virtual Vector<DeprecatedString> render_lines_for_terminal(size_t view_width = 0) const override;
|
2021-09-10 19:36:29 +00:00
|
|
|
virtual RecursionDecision walk(Visitor&) const override;
|
2020-09-20 16:12:23 +00:00
|
|
|
|
2019-09-20 21:46:18 +00:00
|
|
|
private:
|
2021-09-07 01:11:46 +00:00
|
|
|
Text m_text;
|
2019-09-20 21:46:18 +00:00
|
|
|
};
|
2020-04-28 19:04:25 +00:00
|
|
|
|
|
|
|
}
|