1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:08:11 +00:00

LibXML: Set parents for text and comment nodes

This commit is contained in:
Dan Klishch 2023-08-15 10:15:43 -04:00 committed by Ali Mohammad Pur
parent 6368e6ca12
commit 1079f178cf

View file

@ -130,7 +130,7 @@ void Parser::append_text(StringView text, Offset offset)
}
Node::Text text_node;
text_node.builder.append(text);
node.children.append(make<Node>(offset, move(text_node)));
node.children.append(make<Node>(offset, move(text_node), m_entered_node));
},
[&](auto&) {
// Can't enter a text or comment node.
@ -152,7 +152,7 @@ void Parser::append_comment(StringView text, Offset offset)
m_entered_node->content.visit(
[&](Node::Element& node) {
node.children.append(make<Node>(offset, Node::Comment { text }));
node.children.append(make<Node>(offset, Node::Comment { text }, m_entered_node));
},
[&](auto&) {
// Can't enter a text or comment node.