1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 13:17:35 +00:00

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

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);