When using insertHeadTag
, the original method used with strip_tags
was too trigger-happy and could potentially strip out valid/wanted HTML from javascript, where it contained e.g. a variable with HTML to be rendered by the javascript (templates etc.)
The new solution is to take the contents of the <script></script>
tags instead.