Truly independent web browser
LibWeb: Escape linkified URLs in view-source output
Andreas Kling70b2b05fbfa9
diff --git a/Libraries/LibWeb/Loader/SourceHighlighter.cpp b/Libraries/LibWeb/Loader/SourceHighlighter.cppindex 9c92bc0b86a..2f33bf3b189 100644--- a/Libraries/LibWeb/Loader/SourceHighlighter.cpp+++ b/Libraries/LibWeb/Loader/SourceHighlighter.cpp@@ -307,7 +307,7 @@ String SourceHighlighterClient::to_html_string(Optional<URL::URL> const& url, URlinkify_attribute = text.as_string() == href || text.as_string() == src;} else if (span->data == to_underlying(Web::HTML::AugmentedTokenKind::AttributeValue)) {if (auto href = resolve_url_for_attribute(text); href.has_value()) {- builder.appendff("<a href=\"{}\">", *href);+ builder.appendff("<a href=\"{}\">", escape_html_entities(href->serialize()));append_anchor_close = true;}}