From 88f4168dc68dce76c4de038156660579bfeb522e Mon Sep 17 00:00:00 2001 From: quietone <quietone@2572884.no-reply.drupal.org> Date: Fri, 25 Apr 2025 20:25:21 +1200 Subject: [PATCH] Issue #3498468 by nexusnovaz, avpaderno, wombatbuddy, poker10: The example code given for FormattableMarkup::placeholderFormat() contains typos and syntax errors (cherry picked from commit 7caa7cbd5975878c62d79e8ce7ca1274ce6a0d87) --- core/lib/Drupal/Component/Render/FormattableMarkup.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/lib/Drupal/Component/Render/FormattableMarkup.php b/core/lib/Drupal/Component/Render/FormattableMarkup.php index 26fbc0b47c60..44e8171080ae 100644 --- a/core/lib/Drupal/Component/Render/FormattableMarkup.php +++ b/core/lib/Drupal/Component/Render/FormattableMarkup.php @@ -113,11 +113,11 @@ public function jsonSerialize(): string { * // Wraps $some_variable in an <em> tag. * $this->placeholderFormat('Prefix %foo', ['%foo' => $some_variable]); * // The following are using the : placeholder inside an HTML tag. - * $this->placeholderFormat('<a href=":foo">link text</a>, ['@foo' => $some_variable]); - * $this->placeholderFormat('<a href=":foo" title="static text">link text</a>, ['@foo' => $some_variable]); - * $this->placeholderFormat('<a href=":foo">@foo</a>, ['@foo' => $some_variable]); + * $this->placeholderFormat('<a href=":foo">link text</a>', [':foo' => $some_variable]); + * $this->placeholderFormat('<a href=":foo" title="static text">link text</a>', [':foo' => $some_variable]); + * $this->placeholderFormat('<a href=":foo">link text</a>', [':foo' => $some_variable]); * // Use : placeholder inside an HTML tag. - * $this->placeholderFormat('<img src=":foo" />, ['@foo' => '/image.png']); + * $this->placeholderFormat('<img src=":foo" />', [':foo' => '/image.png']); * @endcode * The above are typical examples of using the placeholders correctly. * -- GitLab