mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 12:27:35 +00:00
LibMarkdown: Implement introspection of the document tree
This commit is contained in:
parent
aca01932bd
commit
24e7196158
23 changed files with 319 additions and 0 deletions
|
@ -6,6 +6,7 @@
|
|||
|
||||
#include <AK/StringBuilder.h>
|
||||
#include <LibMarkdown/Heading.h>
|
||||
#include <LibMarkdown/Visitor.h>
|
||||
|
||||
namespace Markdown {
|
||||
|
||||
|
@ -35,6 +36,15 @@ String Heading::render_for_terminal(size_t) const
|
|||
return builder.build();
|
||||
}
|
||||
|
||||
RecursionDecision Heading::walk(Visitor& visitor) const
|
||||
{
|
||||
RecursionDecision rd = visitor.visit(*this);
|
||||
if (rd != RecursionDecision::Recurse)
|
||||
return rd;
|
||||
|
||||
return m_text.walk(visitor);
|
||||
}
|
||||
|
||||
OwnPtr<Heading> Heading::parse(LineIterator& lines)
|
||||
{
|
||||
if (lines.is_end())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue