Allow custom tag processing in md
This commit is contained in:
parent
22157169c0
commit
101bfb4207
12 changed files with 214 additions and 43 deletions
|
@ -3,6 +3,10 @@
|
|||
#include "MarkdownElement.h"
|
||||
#include "MarkdownComponents.h"
|
||||
|
||||
MarkdownDocument::~MarkdownDocument()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void MarkdownDocument::addElement(std::unique_ptr<MarkdownElement> element)
|
||||
{
|
||||
|
@ -19,14 +23,6 @@ MarkdownElement* MarkdownDocument::getElement(std::size_t idx) const
|
|||
return mElements[idx].get();
|
||||
}
|
||||
|
||||
void MarkdownDocument::doLinkTargetSubstitution(const std::string& targetString, const std::string& replacementString)
|
||||
{
|
||||
for(auto& element : mElements)
|
||||
{
|
||||
element->doFieldSubstitution(MarkdownElement::Type::LINK, targetString, replacementString);
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<MarkdownLink*> MarkdownDocument::getAllLinks() const
|
||||
{
|
||||
std::vector<MarkdownLink*> links;
|
||||
|
@ -49,3 +45,33 @@ std::vector<MarkdownLink*> MarkdownDocument::getAllLinks() const
|
|||
}
|
||||
return links;
|
||||
}
|
||||
|
||||
std::size_t MarkdownDocument::getNumMultilineContexts() const
|
||||
{
|
||||
return mCustomMultilineContexts.size();
|
||||
}
|
||||
|
||||
std::size_t MarkdownDocument::getNumInlineContexts() const
|
||||
{
|
||||
return mCustomInlineContexts.size();
|
||||
}
|
||||
|
||||
MarkdownCustomMultilineElementContext* MarkdownDocument::getMultilineContext(std::size_t idx) const
|
||||
{
|
||||
return mCustomMultilineContexts[idx].get();
|
||||
}
|
||||
|
||||
MarkdownCustomInlineElementContext* MarkdownDocument::getInlineContext(std::size_t idx) const
|
||||
{
|
||||
return mCustomInlineContexts[idx].get();
|
||||
}
|
||||
|
||||
void MarkdownDocument::registerCustomInlineElement(std::unique_ptr<MarkdownCustomInlineElementContext> context)
|
||||
{
|
||||
mCustomInlineContexts.push_back(std::move(context));
|
||||
}
|
||||
|
||||
void MarkdownDocument::registerCustomMultilineElement(std::unique_ptr<MarkdownCustomMultilineElementContext> context)
|
||||
{
|
||||
mCustomMultilineContexts.push_back(std::move(context));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue