@emailens/engine 0.11.3 → 0.11.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/index.cjs +15 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +15 -8
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
[](https://github.com/emailens/engine/actions/workflows/ci.yml)
|
|
11
11
|
[](https://www.npmjs.com/package/@emailens/engine)
|
|
12
12
|
[](./LICENSE)
|
|
13
|
-
[]()
|
|
14
14
|
[](https://nodejs.org/)
|
|
15
15
|
[](https://github.com/emailens/mcp)
|
|
16
16
|
[](https://github.com/emailens/engine/stargazers)
|
package/dist/index.cjs
CHANGED
|
@@ -10690,9 +10690,12 @@ function transformForClient(html, clientId, framework) {
|
|
|
10690
10690
|
]
|
|
10691
10691
|
};
|
|
10692
10692
|
}
|
|
10693
|
-
const
|
|
10693
|
+
const wordEngine = clientId === "outlook-windows-legacy" && /<!--\[if/i.test(html);
|
|
10694
|
+
const source = wordEngine ? resolveMsoBranch(html) : html;
|
|
10694
10695
|
const downleveled = downlevelCSS(source);
|
|
10695
|
-
|
|
10696
|
+
const result = applyTransform(downleveled, config, framework);
|
|
10697
|
+
if (wordEngine) result.html = vmlToCss(result.html);
|
|
10698
|
+
return result;
|
|
10696
10699
|
}
|
|
10697
10700
|
function transformForAllClients(html, framework) {
|
|
10698
10701
|
if (!html || !html.trim()) {
|
|
@@ -10706,14 +10709,18 @@ function transformForAllClients(html, framework) {
|
|
|
10706
10709
|
throw new Error(`HTML input exceeds ${MAX_HTML_SIZE / 1024}KB limit.`);
|
|
10707
10710
|
}
|
|
10708
10711
|
const downleveled = downlevelCSS(html);
|
|
10709
|
-
const
|
|
10710
|
-
|
|
10711
|
-
|
|
10712
|
-
|
|
10712
|
+
const hasOutlookBranch = /<!--\[if/i.test(html);
|
|
10713
|
+
const outlookSource = hasOutlookBranch ? downlevelCSS(resolveMsoBranch(html)) : downleveled;
|
|
10714
|
+
return Object.keys(CLIENT_CONFIGS).map((clientId) => {
|
|
10715
|
+
const wordEngine = clientId === "outlook-windows-legacy" && hasOutlookBranch;
|
|
10716
|
+
const result = applyTransform(
|
|
10717
|
+
wordEngine ? outlookSource : downleveled,
|
|
10713
10718
|
CLIENT_CONFIGS[clientId],
|
|
10714
10719
|
framework
|
|
10715
|
-
)
|
|
10716
|
-
|
|
10720
|
+
);
|
|
10721
|
+
if (wordEngine) result.html = vmlToCss(result.html);
|
|
10722
|
+
return result;
|
|
10723
|
+
});
|
|
10717
10724
|
}
|
|
10718
10725
|
|
|
10719
10726
|
// src/analyze.ts
|