Display plugin block markup raw
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(),
      );