ladybird/Userland/Libraries/LibMarkdown/Visitor.h
Ben Wiederhake d2f9fee4ab LibMarkdown: Recognize and handle comments
This also improves Commonmark coverage, e.g. it fixes tests
HTML_blocks_ex179_2894..2906 and Lists_ex308_5439..5457.

In other words, we go from 271 out of 652 to 273 out of 652.
2021-11-01 21:12:58 +01:00

52 lines
2.3 KiB
C++

/*
* Copyright (c) 2021, Ben Wiederhake <BenWiederhake.GitHub@gmx.de>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/RecursionDecision.h>
#include <LibMarkdown/BlockQuote.h>
#include <LibMarkdown/CodeBlock.h>
#include <LibMarkdown/CommentBlock.h>
#include <LibMarkdown/Document.h>
#include <LibMarkdown/Heading.h>
#include <LibMarkdown/HorizontalRule.h>
#include <LibMarkdown/List.h>
#include <LibMarkdown/Paragraph.h>
#include <LibMarkdown/Table.h>
namespace Markdown {
class Visitor {
public:
Visitor() = default;
virtual ~Visitor() = default;
virtual RecursionDecision visit(Document const&) { return RecursionDecision::Recurse; }
virtual RecursionDecision visit(BlockQuote const&) { return RecursionDecision::Recurse; }
virtual RecursionDecision visit(CodeBlock const&) { return RecursionDecision::Recurse; }
virtual RecursionDecision visit(CommentBlock const&) { return RecursionDecision::Recurse; }
virtual RecursionDecision visit(ContainerBlock const&) { return RecursionDecision::Recurse; }
virtual RecursionDecision visit(Heading const&) { return RecursionDecision::Recurse; }
virtual RecursionDecision visit(HorizontalRule const&) { return RecursionDecision::Recurse; }
virtual RecursionDecision visit(List const&) { return RecursionDecision::Recurse; }
virtual RecursionDecision visit(Paragraph const&) { return RecursionDecision::Recurse; }
virtual RecursionDecision visit(Table const&) { return RecursionDecision::Recurse; }
virtual RecursionDecision visit(Table::Column const&) { return RecursionDecision::Recurse; }
virtual RecursionDecision visit(Text const&) { return RecursionDecision::Recurse; }
virtual RecursionDecision visit(Text::BreakNode const&) { return RecursionDecision::Recurse; }
virtual RecursionDecision visit(Text::CodeNode const&) { return RecursionDecision::Recurse; }
virtual RecursionDecision visit(Text::EmphasisNode const&) { return RecursionDecision::Recurse; }
virtual RecursionDecision visit(Text::LinkNode const&) { return RecursionDecision::Recurse; }
virtual RecursionDecision visit(Text::MultiNode const&) { return RecursionDecision::Recurse; }
virtual RecursionDecision visit(Text::TextNode const&) { return RecursionDecision::Recurse; }
virtual RecursionDecision visit(String const&) { return RecursionDecision::Recurse; }
};
}