AbstractScanner scanner = new StringScanner(source, content);
scanner.setPassThroughElements(new String[] {TAG_SCRIPT});
Token token = scanner.tokenize();
lineInfo = new LineInfo(scanner.getLineStarts());
final RecordingErrorListener errorListener = new RecordingErrorListener();
unit = new HtmlParser(source, errorListener).parse(token, lineInfo);
unit.accept(new RecursiveXmlVisitor<Void>() {
@Override
public Void visitHtmlScriptTagNode(HtmlScriptTagNode node) {
resolveScriptDirectives(node.getScript(), errorListener);
return null;