diff --git a/lib/parsers/parse5.js b/lib/parsers/parse5.js index 870103c3f5..e20bc84419 100644 --- a/lib/parsers/parse5.js +++ b/lib/parsers/parse5.js @@ -4,6 +4,10 @@ var htmlparser2Adapter = require('parse5-htmlparser2-tree-adapter'); exports.parse = function (content, options, isDocument) { var opts = { + scriptingEnabled: + typeof options.scriptingEnabled === 'boolean' + ? options.scriptingEnabled + : true, treeAdapter: htmlparser2Adapter, sourceCodeLocationInfo: options.sourceCodeLocationInfo, }; diff --git a/test/__fixtures__/fixtures.js b/test/__fixtures__/fixtures.js index 79f85ca3f0..e232515c1c 100644 --- a/test/__fixtures__/fixtures.js +++ b/test/__fixtures__/fixtures.js @@ -84,3 +84,13 @@ exports.forms = [ '
', '', ].join(''); + +exports.noscript = [ + '