diff -u b/core/lib/Drupal/Core/Render/Element/HtmlTag.php b/core/lib/Drupal/Core/Render/Element/HtmlTag.php
--- b/core/lib/Drupal/Core/Render/Element/HtmlTag.php
+++ b/core/lib/Drupal/Core/Render/Element/HtmlTag.php
@@ -8,6 +8,7 @@
namespace Drupal\Core\Render\Element;
use Drupal\Component\Utility\SafeMarkup;
+use Drupal\Component\Utility\String;
use Drupal\Core\Template\Attribute;
/**
@@ -94,7 +95,7 @@
$markup = SafeMarkup::set($markup);
}
if (!empty($element['#noscript'])) {
- $element['#markup'] = SafeMarkup::set('');
+ $element['#markup'] = String::format('', ['!markup' => $markup]);
}
else {
$element['#markup'] = $markup;
diff -u b/core/lib/Drupal/Core/Render/Renderer.php b/core/lib/Drupal/Core/Render/Renderer.php
--- b/core/lib/Drupal/Core/Render/Renderer.php
+++ b/core/lib/Drupal/Core/Render/Renderer.php
@@ -9,6 +9,7 @@
use Drupal\Component\Utility\Crypt;
use Drupal\Component\Utility\NestedArray;
+use Drupal\Component\Utility\String;
use Drupal\Core\Cache\Cache;
use Drupal\Core\Cache\CacheContexts;
use Drupal\Core\Cache\CacheFactoryInterface;
@@ -802,7 +803,7 @@
'token' => Crypt::randomBytesBase64(55),
];
- return SafeMarkup::set('' . $context['bar'] . '
',
+ '#markup' => String::format('%bar
', ['%bar' => $context['bar']]),
'#attached' => array(
'drupalSettings' => [
'common_test' => $context,
only in patch2:
unchanged:
--- a/core/modules/contextual/src/Element/ContextualLinksPlaceholder.php
+++ b/core/modules/contextual/src/Element/ContextualLinksPlaceholder.php
@@ -7,6 +7,7 @@
namespace Drupal\contextual\Element;
+use Drupal\Component\Utility\SafeMarkup;
use Drupal\Core\Template\Attribute;
use Drupal\Core\Render\Element\RenderElement;
@@ -47,7 +48,7 @@ public function getInfo() {
* @see _contextual_links_to_id()
*/
public static function preRenderPlaceholder(array $element) {
- $element['#markup'] = '