mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-29 16:21:29 +00:00
Ladybird: Do not include comment start/end sequence in its editable text
Currently, when editing a comment, the `<!--` and `-->` start and end sequences would be included in the generated <input> field. This would result in including that text in the updated comment text. So, for example, in a comment such as: <!-- foo --> Changing "foo" to "bar" would result in the comment: <!--<!-- bar -->--> And this would repeatedly nest for each edit.
This commit is contained in:
parent
42c0ac9352
commit
6595e76fef
Notes:
sideshowbarker
2024-07-17 05:58:46 +09:00
Author: https://github.com/trflynn89 Commit: https://github.com/SerenityOS/serenity/commit/6595e76fef Pull-request: https://github.com/SerenityOS/serenity/pull/22229
|
@ -501,8 +501,10 @@ String InspectorClient::generate_dom_tree(JsonObject const& dom_tree)
|
|||
auto comment = node.get_deprecated_string("data"sv).release_value();
|
||||
comment = escape_html_entities(comment);
|
||||
|
||||
builder.appendff("<span data-node-type=\"comment\" class=\"hoverable editable comment\" {}>", data_attributes.string_view());
|
||||
builder.appendff("<!--{}-->", comment);
|
||||
builder.appendff("<span class=\"hoverable comment\" {}>", data_attributes.string_view());
|
||||
builder.append("<span><!--</span>"sv);
|
||||
builder.appendff("<span data-node-type=\"comment\" class=\"editable\">{}</span>", comment);
|
||||
builder.append("<span>--></span>"sv);
|
||||
builder.append("</span>"sv);
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue