I am making a D8 site where I have some pages that will have Angular javascript to do some updates. The html for these pages are made in a custom module that also adds the JS. The problem is that some tags like <button> are beeing stripped away from the html code. I can of course do some creative JS replacement, but I am sure there is a way to do this properly.

The render array:

public function myFunc() {
    $myFunc = new \Drupal\myModule\myFunction;
    $html = $myFunc->makeMyHtml();
    return [
      '#type' => 'markup',
      '#markup' => $html
    ];
  }

I thought that the type 'markup' would pass more or less untouched, but <button> tags are removed.

Comments

tnfno’s picture