How do I render two links with a pipeline as separator? How do I render two links with a pipeline as separator? For example, $edit and $action are links generated using \Drupal::l(). Then, I edited them with the following code.  

if ($edit) {  
  $action =  $edit . ' | ' .  $action;     
}
else {                 
 $action = $action;          
}                    

$action  = $action . "&lt;span class = 'loader'&gt;&lt;/span&gt;";`    


Instead of links, the page is displaying HTML markup as plain text, but no links.

&lt;a href="/en/node/51357/edit?ser=383&amp;amp;rel=49064&amp;amp;env=1&amp;amp;destination=group/39/"&gt;Edit&lt;/a&gt; | &lt;a href="/archive/" class="archive_deployedRelease" nid="51357"&gt;Archive&lt;/a&gt;&lt;span class = 'loader'&gt;&lt;/span&gt;


Can anyone suggest me how to achieve this?
What you see as displayed HTML is escaped by Twig. Only safe markup is not escaped.

l() produces safe markup, but if you add something to it, the complete string becomes unsafe.

You can use an inline template to get around this problem.

if ($edit) {
  $action = [
    '#type' =&gt; 'inline_template',
    '#template' =&gt; '{{ edit }} | {{ action }}&lt;span class = 'loader'&gt;&lt;/span&gt;',
    '#context' =&gt; [
      'edit' =&gt; $edit,
      'action' =&gt; $action,
    ],
  ];
}