Skip to content

Commit a7ce91d

Browse files
committed
allow disable htmlparser plugin
1 parent 9ea72f0 commit a7ce91d

3 files changed

Lines changed: 17 additions & 2 deletions

File tree

lib/loader/pluginLoader.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@
287287
console.error("Plugin '" + pluginDeclaration.id + "' overridden by", pluginPath);
288288
delete plugins[pluginDeclaration.id]
289289
} else {
290-
console.error("Duplicate plugin id (filename)", pluginPath);
290+
console.error("Duplicate plugin id ignored (filename)", pluginPath);
291291
return;
292292
}
293293
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
export default {
3+
4+
provides: [
5+
// Run for all who requests htmlparser or meta.
6+
'htmlparser',
7+
'__allowHtmlparser'
8+
],
9+
10+
getData: function() {
11+
return {
12+
__allowHtmlparser: true
13+
};
14+
}
15+
};

lib/plugins/system/htmlparser/htmlparser.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export default {
1616
'__statusCode'
1717
],
1818

19-
getData: function(url, whitelistRecord, options, __noCachedHtmlparserFallback, cb) {
19+
getData: function(url, whitelistRecord, options, __noCachedHtmlparserFallback, __allowHtmlparser, cb) {
2020

2121
var options2 = {...options, ...{
2222
followRedirect: !!options.followHTTPRedirect,

0 commit comments

Comments
 (0)