@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 CHANGED
@@ -10,7 +10,7 @@
10
10
  [![CI](https://github.com/emailens/engine/actions/workflows/ci.yml/badge.svg)](https://github.com/emailens/engine/actions/workflows/ci.yml)
11
11
  [![npm](https://img.shields.io/npm/v/@emailens/engine)](https://www.npmjs.com/package/@emailens/engine)
12
12
  [![license](https://img.shields.io/npm/l/@emailens/engine)](./LICENSE)
13
- [![tests](https://img.shields.io/badge/tests-1036%20passing-brightgreen)]()
13
+ [![tests](https://img.shields.io/badge/tests-1087%20passing-brightgreen)]()
14
14
  [![node](https://img.shields.io/node/v/@emailens/engine)](https://nodejs.org/)
15
15
  [![MCP](https://img.shields.io/badge/MCP-Server-blue)](https://github.com/emailens/mcp)
16
16
  [![GitHub stars](https://img.shields.io/github/stars/emailens/engine?style=flat)](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 source = clientId === "outlook-windows-legacy" ? renderOutlookBranch(html) : html;
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
- return applyTransform(downleveled, config, framework);
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 outlookSource = /<!--\[if/i.test(html) ? downlevelCSS(renderOutlookBranch(html)) : downleveled;
10710
- return Object.keys(CLIENT_CONFIGS).map(
10711
- (clientId) => applyTransform(
10712
- clientId === "outlook-windows-legacy" ? outlookSource : downleveled,
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