Skip to content

Commit 8eaa928

Browse files
committed
fix: incoming options not merge with default options
1 parent 29944dc commit 8eaa928

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ function postHTMLParser(html, options) {
2626
};
2727

2828
function parserDirective(name, data) {
29-
var directives = options.directives || defaultDirectives;
29+
var directives = objectAssign(defaultDirectives, options.directives);
3030
var last = bufArray.last();
3131

3232
for (var i = 0; i < directives.length; i++) {
@@ -113,10 +113,10 @@ function postHTMLParser(html, options) {
113113
}
114114

115115
function parserWrapper() {
116-
var option;
116+
var option = {};
117117

118118
function parser(html) {
119-
var opt = option || defaultOptions;
119+
var opt = objectAssign(defaultOptions, option);
120120
return postHTMLParser(html, opt);
121121
}
122122

0 commit comments

Comments
 (0)