diff --git a/core/includes/theme.inc b/core/includes/theme.inc
index cfdfa89..0d3d322 100644
--- a/core/includes/theme.inc
+++ b/core/includes/theme.inc
@@ -16,6 +16,7 @@
 use Drupal\Component\Utility\Xss;
 use Drupal\Core\Config\Config;
 use Drupal\Core\Config\StorageException;
+use Drupal\Core\Render\SafeString;
 use Drupal\Core\Template\Attribute;
 use Drupal\Core\Theme\ThemeSettings;
 use Drupal\Component\Utility\NestedArray;
@@ -1290,10 +1291,9 @@ function template_preprocess_html(&$variables) {
   ];
   $token = Crypt::randomBytesBase64(55);
   foreach ($types as $type) {
-    $placeholder = SafeMarkup::format('<drupal-html-response-attachment-placeholder type="@type" token="@token"></drupal-html-response-attachment-placeholder>', [
-      '@type' => $type,
-      '@token' => $token,
-    ]);
+    // We can construct a SafeString as we know that both $type and $token is
+    // perfectly fine.
+    $placeholder = SafeString::create("<drupal-html-response-attachment-placeholder type=\"$type\" token=\"$token\"></drupal-html-response-attachment-placeholder>");
     $variables[$type]['#markup'] = $placeholder;
     $variables[$type]['#attached']['html_response_placeholders'][$type] = $placeholder;
   }
