Display plugin block markup raw I have built a custom block plugin in Drupal 8. However, I needed to insert some svg elements in the markup, which get all filtered out. Is there a way for me to specify to display the raw output, so that the svg does not get filtered out?    

  public function build() {

    return array(
      '#type' =&gt; 'markup',
      '#markup' =&gt; '&lt;div&gt;&lt;svg&gt;.....&lt;/svg&gt;&lt;/div&gt;',
    );
 }
?&gt;


I have tried adding '#template' =&gt; '{{ value|raw }}' and played some with it - but could not get it to work. There must be some way to allow me to insert svg in there...
You can use an inline template:

  public function build() {

  return array(
    '#type' =&gt; 'inline_template',
    '#template' =&gt; '&lt;div&gt;&lt;svg&gt;{{ var }}&lt;/svg&gt;&lt;/div&gt;',
    '#context' =&gt; array(
      'var' =&gt; $svg,
    ),
  );


You can use the inline template with an empty context, if you have no vars that need to be escaped:

  return array(
        '#type' =&gt; 'inline_template',
        '#template' =&gt; '&lt;div&gt;&lt;svg&gt;...&lt;/svg&gt;&lt;/div&gt;',
        '#context' =&gt; array(),
      );