force template html as html code, not an url or file path
ensure that external resources are not loaded by jsdom
This commit is contained in:
parent
9d5fb816c9
commit
0879fa412a
1 changed files with 7 additions and 2 deletions
|
@ -199,8 +199,13 @@ function prepareHtml(html, callback) {
|
|||
if (!(html || '').toString().trim()) {
|
||||
return callback(null, false);
|
||||
}
|
||||
|
||||
jsdom.env(html, (err, win) => {
|
||||
jsdom.env(false, false, {
|
||||
html,
|
||||
features: {
|
||||
FetchExternalResources: false, // disables resource loading over HTTP / filesystem
|
||||
ProcessExternalResources: false // do not execute JS within script blocks
|
||||
}
|
||||
}, (err, win) => {
|
||||
if (err) {
|
||||
return callback(err);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue