You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
714 B

#include "TagNode.h"
#include "elements/H1Element.h"
#include "elements/H2Element.h"
#include "elements/H3Element.h"
#include "elements/LIElement.h"
#include "elements/PElement.h"
const Element TagNode::elements[] = {
{"h1", &H1Element::render},
{"h2", &H2Element::render},
{"h3", &H3Element::render},
{"li", &LIElement::render},
{"p", &PElement::render}
TagNode::TagNode() : Node(NodeType::TAG) {
std::unique_ptr<Component> TagNode::render(const Node &node, int y, int windowWidth, int windowHeight) {
for (Element element : elements) {
if (tag == element.tag) {
return element.render(node, y, windowWidth, windowHeight);
return nullptr;