public function computeForScript($html)
{
if (1 !== preg_match_all('/<script[^>]*>/i', $html, $m)) {
throw new \InvalidArgumentException('Invalid script, you should use a single <script> tag.');
}
preg_match('/^\\s*<script[^>]*>((?s).*)<\\/script>\\s*$/i', $html, $matches);
if (!isset($matches[1])) {
throw new \InvalidArgumentException('Invalid script, no <script> tag found.');
}
return $this->compute($matches[1]);
}