Skip to content

Commit

Permalink
Pass locationInfo option to parse5 (#1155)
Browse files Browse the repository at this point in the history
  • Loading branch information
trevorhreed authored and fb55 committed Mar 9, 2018
1 parent 7720628 commit 518c93e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ exports = module.exports = function(content, options, isDocument) {
return root;
};

function parseWithParse5 (content, isDocument) {
function parseWithParse5 (content, options, isDocument) {
var parse = isDocument ? parse5.parse : parse5.parseFragment,
root = parse(content, { treeAdapter: parse5.treeAdapters.htmlparser2 });
root = parse(content, { treeAdapter: parse5.treeAdapters.htmlparser2, locationInfo: options.locationInfo });

return root.children;
}
Expand All @@ -39,7 +39,7 @@ exports.evaluate = function(content, options, isDocument) {
if (typeof content === 'string') {
var useHtmlParser2 = options.xmlMode || options._useHtmlParser2;

dom = useHtmlParser2 ? htmlparser.parseDOM(content, options) : parseWithParse5(content, isDocument);
dom = useHtmlParser2 ? htmlparser.parseDOM(content, options) : parseWithParse5(content, options, isDocument);
} else {
dom = content;
}
Expand Down

0 comments on commit 518c93e

Please sign in to comment.