mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-30 00:31:14 +00:00
LibWeb+Base: Convert String::format() to String::formatted()
This error page template is slightly hilarious and should probably be replaced with AK::SourceGenerator or some such, but for now let's just get rid of the call to String::format().
This commit is contained in:
parent
e924da6c73
commit
9a8dd38493
Notes:
sideshowbarker
2024-07-18 19:15:44 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/9a8dd38493f
|
@ -14,8 +14,8 @@
|
||||||
<body>
|
<body>
|
||||||
<header>
|
<header>
|
||||||
<img src="file:///res/icons/32x32/msgbox-warning.png" alt="Warning" width="24" height="24">
|
<img src="file:///res/icons/32x32/msgbox-warning.png" alt="Warning" width="24" height="24">
|
||||||
<h1>Failed to load %s</h1>
|
<h1>Failed to load {}</h1>
|
||||||
</header>
|
</header>
|
||||||
<p>Error: %s</p>
|
<p>Error: {}</p>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -227,10 +227,10 @@ void FrameLoader::load_error_page(const URL& failed_url, const String& error)
|
||||||
[this, failed_url, error](auto data, auto&, auto) {
|
[this, failed_url, error](auto data, auto&, auto) {
|
||||||
VERIFY(!data.is_null());
|
VERIFY(!data.is_null());
|
||||||
#pragma GCC diagnostic ignored "-Wformat-nonliteral"
|
#pragma GCC diagnostic ignored "-Wformat-nonliteral"
|
||||||
auto html = String::format(
|
auto html = String::formatted(
|
||||||
String::copy(data).characters(),
|
data,
|
||||||
escape_html_entities(failed_url.to_string()).characters(),
|
escape_html_entities(failed_url.to_string()),
|
||||||
escape_html_entities(error).characters());
|
escape_html_entities(error));
|
||||||
#pragma GCC diagnostic pop
|
#pragma GCC diagnostic pop
|
||||||
auto document = HTML::parse_html_document(html, failed_url, "utf-8");
|
auto document = HTML::parse_html_document(html, failed_url, "utf-8");
|
||||||
VERIFY(document);
|
VERIFY(document);
|
||||||
|
|
Loading…
Reference in a new issue