From 763ca8654024eaaf8f8c167f9dac3eeccd93b2ab Mon Sep 17 00:00:00 2001 From: Alexandru Barascu Date: Fri, 24 Jul 2026 11:19:50 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#75162=20[mjml-core?= =?UTF-8?q?]=20Add=20includePath=20option=20(mjml=205.1)=20by=20@NoMercy23?= =?UTF-8?q?5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/mjml-core/index.d.ts | 6 ++++++ types/mjml-core/mjml-core-tests.ts | 2 ++ types/mjml-core/package.json | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/types/mjml-core/index.d.ts b/types/mjml-core/index.d.ts index 485243c92d3fa7..d93aa3b13f975c 100644 --- a/types/mjml-core/index.d.ts +++ b/types/mjml-core/index.d.ts @@ -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() diff --git a/types/mjml-core/mjml-core-tests.ts b/types/mjml-core/mjml-core-tests.ts index 136797a3a4255e..0e6c4d79f01fb8 100644 --- a/types/mjml-core/mjml-core-tests.ts +++ b/types/mjml-core/mjml-core-tests.ts @@ -10,6 +10,8 @@ async function tests() { const minimal_opts_test = await mjml2html("", { beautify: true }); const validation_level_test = await mjml2html("", { validationLevel: "strict" }); const filePath_test = await mjml2html("", { filePath: "." }); + const includePath_test = await mjml2html("", { includePath: "./templates" }); + const includePath_array_test = await mjml2html("", { includePath: ["./templates", "./partials"] }); const jsonObject = { tagName: "mjml", attributes: { width: "100px" }, content: "test content" }; const jsonObject_test = await mjml2html(jsonObject); diff --git a/types/mjml-core/package.json b/types/mjml-core/package.json index 6dc701bff45cb8..2fef357efc0f8b 100644 --- a/types/mjml-core/package.json +++ b/types/mjml-core/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@types/mjml-core", - "version": "5.0.9999", + "version": "5.1.9999", "projects": [ "https://mjml.io" ],