Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions types/mjml-core/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ export interface MJMLParsingOptions {
* default: '.'
*/
filePath?: string | undefined;
/**
* Directory (or directories) outside the template's own folder from which mj-include
* partials may be loaded. Added in mjml 5.1 as part of the include path-traversal hardening;
* includes resolving outside these allowed roots are denied.
*/
includePath?: string | string[] | undefined;
/**
* The path or directory of the .mjmlconfig file
* default: process.cwd()
Expand Down
2 changes: 2 additions & 0 deletions types/mjml-core/mjml-core-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ async function tests() {
const minimal_opts_test = await mjml2html("<mjml>", { beautify: true });
const validation_level_test = await mjml2html("<mjml>", { validationLevel: "strict" });
const filePath_test = await mjml2html("<mjml>", { filePath: "." });
const includePath_test = await mjml2html("<mjml>", { includePath: "./templates" });
const includePath_array_test = await mjml2html("<mjml>", { includePath: ["./templates", "./partials"] });

const jsonObject = { tagName: "mjml", attributes: { width: "100px" }, content: "test content" };
const jsonObject_test = await mjml2html(jsonObject);
Expand Down
2 changes: 1 addition & 1 deletion types/mjml-core/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "@types/mjml-core",
"version": "5.0.9999",
"version": "5.1.9999",
"projects": [
"https://mjml.io"
],
Expand Down