MarkdownToHtmlTranspiler/lib/inlineNode.cpp
Hayden Hargreaves 1c81d2aa41 (FEAT): Includes support for code block segments.
This includes the addition of lots of new node elements.
2025-10-28 17:45:40 -07:00

28 lines
705 B
C++

#include "inlineNode.h"
#include <memory>
#include <stdexcept>
#include <string>
using std::string;
void InlineNode::AddChild(std::unique_ptr<Node> child) {
throw std::runtime_error("Cannot add a child to an InlineNode.");
}
string TextNode::ToHtml() const { return this->content; }
string ItalicNode::ToHtml() const { return "<em>" + this->content + "</em>"; }
string BoldNode::ToHtml() const {
return "<strong>" + this->content + "</strong>";
}
string BoldItalicNode::ToHtml() const {
return "<strong><em>" + this->content + "</em></strong>";
}
string CodeNode::ToHtml() const { return "<code>" + this->content + "</code>"; }
string RawTextNode::ToHtml() const { return this->content; };