// ### STRIP JAVASCRIPT (‘<script>’ tags) FROM SUPPLIED STRING ARGUMENT ###
function remove_javascript_from_content($slide_content) {
$dom = new DOMDocument();
$dom->loadHTML($slide_content);
$script = $dom->getElementsByTagName(‘script’);
$remove = [];
foreach($script as $item) {
$item->parentNode->removeChild($item);
}
$slide_content = $dom->saveHTML();
return $slide_content;
}
?>