Drupal 8 - Add custom HTML with script to embed on a page as block I need to add a custom form that has scripts and styles into a page as a block. Its dynamic, so I couldn't attach the scripts (#attached) as libraries. I just need to place the contents as is. 

$build['test'] = [
  '#markup' =&gt; $test_code,
  '#allowed_tags' =&gt; [
    'script',
    'style',
    'form',
    'input',
  ],
];


I tried it as shown above, but this wasn't working. So, I removed, scripts and style as shown below and that works:

$build['test'] = [
  '#markup' =&gt; $test_code,
  '#allowed_tags' =&gt; [
    'form',
    'input',
  ],
];


Any possible solution to render the contents without filtering scripts and style.
You can use :

$build['test'] = [
  '#children' =&gt; $test_code,
];