How to use HTML entities in links in Drupal 8? I have a client who prefers some links to have the » symbol at the end. This is typically produced with the &raquo; HTML character entity.

In Drupal 7, you would do something like this:

l('Go there &amp;raquo;', 'node/1', array('html' =&gt; TRUE));


But how do you do it in Drupal 8? The following won't work because of new sanitization rules:

$node-&gt;toLink('Go there &amp;raquo;', 'canonical', ['html' =&gt; TRUE]);


They want the raquo in the link, not as a suffix.
The cleanst solution for this is doing it in CSS:

.my_link_css_class::after {
  content: '\00a0\00bb';
}


(\00a0 is for a space, \00bb is for the &raquo;)