@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/dist/index.js
CHANGED
|
@@ -10571,9 +10571,12 @@ function transformForClient(html, clientId, framework) {
|
|
|
10571
10571
|
]
|
|
10572
10572
|
};
|
|
10573
10573
|
}
|
|
10574
|
-
const
|
|
10574
|
+
const wordEngine = clientId === "outlook-windows-legacy" && /<!--\[if/i.test(html);
|
|
10575
|
+
const source = wordEngine ? resolveMsoBranch(html) : html;
|
|
10575
10576
|
const downleveled = downlevelCSS(source);
|
|
10576
|
-
|
|
10577
|
+
const result = applyTransform(downleveled, config, framework);
|
|
10578
|
+
if (wordEngine) result.html = vmlToCss(result.html);
|
|
10579
|
+
return result;
|
|
10577
10580
|
}
|
|
10578
10581
|
function transformForAllClients(html, framework) {
|
|
10579
10582
|
if (!html || !html.trim()) {
|
|
@@ -10587,14 +10590,18 @@ function transformForAllClients(html, framework) {
|
|
|
10587
10590
|
throw new Error(`HTML input exceeds ${MAX_HTML_SIZE / 1024}KB limit.`);
|
|
10588
10591
|
}
|
|
10589
10592
|
const downleveled = downlevelCSS(html);
|
|
10590
|
-
const
|
|
10591
|
-
|
|
10592
|
-
|
|
10593
|
-
|
|
10593
|
+
const hasOutlookBranch = /<!--\[if/i.test(html);
|
|
10594
|
+
const outlookSource = hasOutlookBranch ? downlevelCSS(resolveMsoBranch(html)) : downleveled;
|
|
10595
|
+
return Object.keys(CLIENT_CONFIGS).map((clientId) => {
|
|
10596
|
+
const wordEngine = clientId === "outlook-windows-legacy" && hasOutlookBranch;
|
|
10597
|
+
const result = applyTransform(
|
|
10598
|
+
wordEngine ? outlookSource : downleveled,
|
|
10594
10599
|
CLIENT_CONFIGS[clientId],
|
|
10595
10600
|
framework
|
|
10596
|
-
)
|
|
10597
|
-
|
|
10601
|
+
);
|
|
10602
|
+
if (wordEngine) result.html = vmlToCss(result.html);
|
|
10603
|
+
return result;
|
|
10604
|
+
});
|
|
10598
10605
|
}
|
|
10599
10606
|
|
|
10600
10607
|
// src/analyze.ts
|