MarkdownToHtmlTranspiler/lib/inlineNode.cpp
Hayden Hargreaves 14d5eee237 (FEAT): Working on node implementation.
The inline and structure nodes have some basic implementations. The
parser needs to begin next.
2025-10-16 12:08:58 -07:00

24 lines
560 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>";
}