When using $domScript->textContent, DOM library starts parsing some tags within strings and messes the output up. For example alert("<span>text</span>"); becomes alert("<span>text");
So instead of DOM operations, we extract script contents with a regex.
When using
$domScript->textContent
, DOM library starts parsing some tags within strings and messes the output up. For examplealert("<span>text</span>");
becomesalert("<span>text");
So instead of DOM operations, we extract script contents with a regex.