CommentBlock.h 843 B

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. * Copyright (c) 2021, Ben Wiederhake <BenWiederhake.GitHub@gmx.de>
  3. * Copyright (c) 2022, the SerenityOS developers.
  4. *
  5. * SPDX-License-Identifier: BSD-2-Clause
  6. */
  7. #pragma once
  8. #include <AK/ByteString.h>
  9. #include <AK/OwnPtr.h>
  10. #include <LibMarkdown/Block.h>
  11. #include <LibMarkdown/LineIterator.h>
  12. namespace Markdown {
  13. class CommentBlock final : public Block {
  14. public:
  15. CommentBlock(ByteString const& comment)
  16. : m_comment(comment)
  17. {
  18. }
  19. virtual ~CommentBlock() override = default;
  20. virtual ByteString render_to_html(bool tight = false) const override;
  21. virtual Vector<ByteString> render_lines_for_terminal(size_t view_width = 0) const override;
  22. virtual RecursionDecision walk(Visitor&) const override;
  23. static OwnPtr<CommentBlock> parse(LineIterator& lines);
  24. private:
  25. ByteString m_comment;
  26. };
  27. }