Paragraph.h 728 B

12345678910111213141516171819202122232425262728293031323334
  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/NonnullOwnPtrVector.h>
  9. #include <AK/OwnPtr.h>
  10. #include <LibMarkdown/Block.h>
  11. #include <LibMarkdown/Text.h>
  12. namespace Markdown {
  13. class Paragraph final : public Block {
  14. public:
  15. Paragraph(Text text)
  16. : m_text(move(text))
  17. {
  18. }
  19. virtual ~Paragraph() override = default;
  20. virtual String render_to_html(bool tight = false) const override;
  21. virtual String render_for_terminal(size_t view_width = 0) const override;
  22. virtual RecursionDecision walk(Visitor&) const override;
  23. private:
  24. Text m_text;
  25. };
  26. }