Paragraph.h 714 B

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. * Copyright (c) 2019-2020, Sergey Bugaev <bugaevc@serenityos.org>
  3. * Copyright (c) 2022, the SerenityOS developers.
  4. *
  5. * SPDX-License-Identifier: BSD-2-Clause
  6. */
  7. #pragma once
  8. #include <AK/OwnPtr.h>
  9. #include <LibMarkdown/Block.h>
  10. #include <LibMarkdown/Text.h>
  11. namespace Markdown {
  12. class Paragraph final : public Block {
  13. public:
  14. Paragraph(Text text)
  15. : m_text(move(text))
  16. {
  17. }
  18. virtual ~Paragraph() override = default;
  19. virtual ByteString render_to_html(bool tight = false) const override;
  20. virtual Vector<ByteString> render_lines_for_terminal(size_t view_width = 0) const override;
  21. virtual RecursionDecision walk(Visitor&) const override;
  22. private:
  23. Text m_text;
  24. };
  25. }