mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-26 12:41:59 +03:00
LibWebView: Escape HTML within attribute values in the Inspector HTML
If an attribute value contains HTML, let's make sure we render it as text, instead of injecting HTML in the middle of an Inspector field.
This commit is contained in:
parent
fd558a012b
commit
338f0382d3
Notes:
sideshowbarker
2024-07-17 22:09:47 +09:00
Author: https://github.com/trflynn89 Commit: https://github.com/SerenityOS/serenity/commit/338f0382d3 Pull-request: https://github.com/SerenityOS/serenity/pull/23251 Issue: https://github.com/SerenityOS/serenity/issues/23241
@ -542,7 +542,7 @@ String InspectorClient::generate_dom_tree(JsonObject const& dom_tree)
|
||||
builder.appendff("<span data-node-type=\"attribute\" data-tag=\"{}\" data-attribute-index={} class=\"editable\">", tag, dom_node_attributes.size());
|
||||
builder.appendff("<span class=\"attribute-name\">{}</span>", name);
|
||||
builder.append('=');
|
||||
builder.appendff("<span class=\"attribute-value\">\"{}\"</span>", value_string);
|
||||
builder.appendff("<span class=\"attribute-value\">\"{}\"</span>", escape_html_entities(value_string));
|
||||
builder.append("</span>"sv);
|
||||
|
||||
dom_node_attributes.empend(MUST(String::from_byte_string(name)), MUST(String::from_byte_string(value_string)));
|
||||
|
Loading…
Reference in New Issue
Block a user