-
Notifications
You must be signed in to change notification settings - Fork 44
Open
Description
Example:
inlineSource(path, {
rootpath: 'fofdsafndsgnsfdlkjgfjndlksgjno'
})
.then((html) => {
// Do something with html
console.log('html: ', html);
})
.catch((err) => {
console.log('err: ', err);
// Handle error
});
We pass it into the context but it doesn't look like anything happens with it:
const ctx = context.create(options);
console.log('ctx: ', ctx.rootpath); // This has the correct path
// Load html content
if (isFilepath(htmlpath)) {
ctx.htmlpath = path.resolve(htmlpath);
try {
ctx.html = ctx.fs.readFileSync(ctx.htmlpath, 'utf8');
} catch (err) {
return reject(err);
}
// Passed file content instead of path
} else {
ctx.html = htmlpath;
}
Metadata
Metadata
Assignees
Labels
No labels