2020-01-18 09:38:21 +01:00
|
|
|
/*
|
2020-01-24 16:45:29 +03:00
|
|
|
* Copyright (c) 2019-2020, Sergey Bugaev <bugaevc@serenityos.org>
|
2022-03-04 13:21:26 -07:00
|
|
|
* Copyright (c) 2022, the SerenityOS developers.
|
2020-01-18 09:38:21 +01:00
|
|
|
*
|
2021-04-22 01:24:48 -07:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-01-18 09:38:21 +01:00
|
|
|
*/
|
|
|
|
|
|
2019-09-21 00:46:18 +03:00
|
|
|
#pragma once
|
|
|
|
|
|
2021-09-10 21:36:29 +02:00
|
|
|
#include <AK/RecursionDecision.h>
|
2020-04-28 21:04:25 +02:00
|
|
|
#include <AK/StringView.h>
|
2020-02-14 21:41:10 +01:00
|
|
|
#include <AK/Vector.h>
|
2021-09-10 21:36:29 +02:00
|
|
|
#include <LibMarkdown/Forward.h>
|
2019-09-21 00:46:18 +03:00
|
|
|
|
2020-04-28 21:04:25 +02:00
|
|
|
namespace Markdown {
|
|
|
|
|
|
|
|
|
|
class Block {
|
2019-09-21 00:46:18 +03:00
|
|
|
public:
|
2022-03-04 13:21:26 -07:00
|
|
|
virtual ~Block() = default;
|
2019-09-21 00:46:18 +03:00
|
|
|
|
2023-12-16 17:49:34 +03:30
|
|
|
virtual ByteString render_to_html(bool tight = false) const = 0;
|
|
|
|
|
virtual Vector<ByteString> render_lines_for_terminal(size_t view_width = 0) const = 0;
|
2021-09-10 21:36:29 +02:00
|
|
|
virtual RecursionDecision walk(Visitor&) const = 0;
|
2019-09-21 00:46:18 +03:00
|
|
|
};
|
2020-04-28 21:04:25 +02:00
|
|
|
|
|
|
|
|
}
|