LibWeb: Escape text nodes in innerHTML getter

This commit is contained in:
Linus Groh 2020-12-17 14:26:46 +00:00 committed by Andreas Kling
parent 4833f0066e
commit 3436317c08
Notes: sideshowbarker 2024-07-19 00:46:41 +09:00

View file

@ -316,8 +316,10 @@ String Element::inner_html() const
builder.append('>');
}
if (child->is_text()) {
builder.append(downcast<Text>(*child).data());
auto& text = downcast<Text>(*child);
builder.append(escape_string(text.data(), false));
}
// FIXME: Also handle Comment, ProcessingInstruction, DocumentType
}
};
recurse(*this);