Some methods/functions use code similar to the following one.
$build['description'] = [
'#markup' => $this->t('Content Entity Example implements a Contacts model. These contacts are fieldable entities. You can manage the fields on the <a href="@adminlink">Contacts admin page</a>.', [
'@adminlink' => $this->urlGenerator->generateFromRoute('content_entity_example.contact_settings'),
]),
];
The placeholder used for the href attribute is @variable, while the correct one would be :variable, as reported on FormattableMarkup::placeholderFormat().
:variable: Return value is escaped with
\Drupal\Component\Utility\Html::escape()and filtered for dangerous protocols usingUrlHelper::stripDangerousProtocols(). Use this when using the "href" attribute, ensuring the attribute value is always wrapped in quotes
Any occurrence of <a href="@ in translatable strings must be replaced with <a href=":
Issue fork examples-3458274
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
avpadernoComment #3
avpadernoComment #4
sourabhsisodia_ commentedComment #5
avpadernoComment #7
sourabhsisodia_ commentedComment #9
avpadernoThank you for the MR. I merged it and made a commit!