Correctly parse javascript inside of a script tag