diff --git a/core/lib/Drupal/Core/Template/TwigExtension.php b/core/lib/Drupal/Core/Template/TwigExtension.php index 3ebe01b..f61acc7 100644 --- a/core/lib/Drupal/Core/Template/TwigExtension.php +++ b/core/lib/Drupal/Core/Template/TwigExtension.php @@ -8,6 +8,7 @@ use Drupal\Core\Datetime\DateFormatterInterface; use Drupal\Core\Render\AttachmentsInterface; use Drupal\Core\Render\BubbleableMetadata; +use Drupal\Core\Render\Markup; use Drupal\Core\Render\RenderableInterface; use Drupal\Core\Render\RendererInterface; use Drupal\Core\Routing\UrlGeneratorInterface; @@ -273,6 +274,9 @@ public function getLink($text, $url, $attributes = []) { } $url->setOption('attributes', $attributes); } + if ($text instanceof \Twig_Markup) { + $text = Markup::create($text); + } $build = [ '#type' => 'link', '#title' => $text,