Pass raw html to #markup I have some html content, it comes from a external library so i can not change it, it has many &lt;span&gt; and &lt;div&gt; tags with attributes like:
&lt;span style="color: #0000ff;"&gt;, but when i use:

$render = array(
  '#markup' =&gt; $myhtmlcontent,
);


In a render array, Drupal strips the attributes, and it keeps just &lt;span&gt; without the styles.  

So, how can I avoid Drupal changes what I pass as markup, which doesn't need any filter because the library makes it safe, or at last make it allow styles?
Use inline template:

  return [
    '#type' =&gt; 'inline_template',
    '#template' =&gt; '{{ somecontent }}',
    '#context' =&gt; [
      'somecontent' =&gt; $somecontent
    ]
  ];


In your case without context, just straight up html.

You can also use the html_tag element for things like script or link and so on.