mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 07:17:35 +00:00
LibWeb: Escape text nodes in innerHTML getter
This commit is contained in:
parent
4833f0066e
commit
3436317c08
1 changed files with 3 additions and 1 deletions
|
@ -316,8 +316,10 @@ String Element::inner_html() const
|
||||||
builder.append('>');
|
builder.append('>');
|
||||||
}
|
}
|
||||||
if (child->is_text()) {
|
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);
|
recurse(*this);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue