mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-22 04:25:13 +00:00
LibWeb: Escape text nodes in innerHTML getter
This commit is contained in:
parent
4833f0066e
commit
3436317c08
Notes:
sideshowbarker
2024-07-19 00:46:41 +09:00
Author: https://github.com/linusg Commit: https://github.com/SerenityOS/serenity/commit/3436317c083 Pull-request: https://github.com/SerenityOS/serenity/pull/4442 Reviewed-by: https://github.com/awesomekling
1 changed files with 3 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue