From 6595e76fefd839d7b15f84f3ecf172f5be40399f Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Sat, 9 Dec 2023 17:10:10 -0500 Subject: [PATCH] Ladybird: Do not include comment start/end sequence in its editable text Currently, when editing a comment, the `` start and end sequences would be included in the generated field. This would result in including that text in the updated comment text. So, for example, in a comment such as: Changing "foo" to "bar" would result in the comment: --> And this would repeatedly nest for each edit. --- Userland/Libraries/LibWebView/InspectorClient.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Userland/Libraries/LibWebView/InspectorClient.cpp b/Userland/Libraries/LibWebView/InspectorClient.cpp index 4182240769..bcb5172a84 100644 --- a/Userland/Libraries/LibWebView/InspectorClient.cpp +++ b/Userland/Libraries/LibWebView/InspectorClient.cpp @@ -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("", data_attributes.string_view()); - builder.appendff("<!--{}-->", comment); + builder.appendff("", data_attributes.string_view()); + builder.append("<!--"sv); + builder.appendff("{}", comment); + builder.append("-->"sv); builder.append(""sv); return; }