mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 02:07:36 +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/BlockQuote.h>
|
||||
#include <LibMarkdown/Visitor.h>
|
||||
|
||||
namespace Markdown {
|
||||
|
||||
|
@ -24,6 +25,15 @@ String BlockQuote::render_for_terminal(size_t view_width) const
|
|||
return m_contents->render_for_terminal(view_width);
|
||||
}
|
||||
|
||||
RecursionDecision BlockQuote::walk(Visitor& visitor) const
|
||||
{
|
||||
RecursionDecision rd = visitor.visit(*this);
|
||||
if (rd != RecursionDecision::Recurse)
|
||||
return rd;
|
||||
|
||||
return m_contents->walk(visitor);
|
||||
}
|
||||
|
||||
OwnPtr<BlockQuote> BlockQuote::parse(LineIterator& lines)
|
||||
{
|
||||
lines.push_context(LineIterator::Context::block_quote());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue