Skip to content

Commit 24c5e4e

Browse files
committed
use htmlparser2/lib/Parser directly
1 parent 923b16a commit 24c5e4e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
var htmlparser = require('htmlparser2');
3+
var Parser = require('htmlparser2/lib/Parser');
44
var isObject = require('isobject');
55
var objectAssign = require('object-assign');
66

@@ -56,7 +56,7 @@ function postHTMLParser(html, options) {
5656
return result;
5757
}
5858

59-
var parser = new htmlparser.Parser({
59+
var parser = new Parser({
6060
onprocessinginstruction: parserDirective,
6161
oncomment: function(data) {
6262
var comment = '<!--' + data + '-->',

test/test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ describe('PostHTML-Parser test', function() {
2828

2929
// Replace real htmlparser2 dependency of posthtml-parser with mocked
3030
parserWithMockedDeps.__set__({
31-
htmlparser: {Parser: parserSpy}
31+
Parser: parserSpy
3232
});
3333
});
3434

0 commit comments

Comments
 (0)