design-embed 0.2.0 → 0.2.1

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/dist/cli.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { a as formatDiagnosticText, d as loadConfig, i as checkGeneratedFiles, n as embed, o as toJsonDiagnostics } from "./core-BLV62TaX.mjs";
2
+ import { a as formatDiagnosticText, d as loadConfig, i as checkGeneratedFiles, n as embed, o as toJsonDiagnostics } from "./core-DSlWqRBj.mjs";
3
3
  import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
4
4
  import { dirname, resolve } from "node:path";
5
5
  //#region packages/design-embed/src/args.ts
@@ -760,12 +760,12 @@ function parseHtml(html) {
760
760
  children: []
761
761
  };
762
762
  const stack = [root];
763
- const tokens = html.matchAll(/<!--[\s\S]*?-->|<\/?[a-zA-Z][^>]*>|[^<]+/g);
763
+ const tokens = html.matchAll(/<!--[\s\S]*?-->|<![A-Za-z][^>]*>|<\/?[a-zA-Z][^>]*>|[^<]+/g);
764
764
  for (const token of tokens) {
765
765
  const value = token[0];
766
766
  const offset = token.index;
767
767
  const source = getSourceLocation(html, offset);
768
- if (value.startsWith("<!--")) continue;
768
+ if (value.startsWith("<!--") || value.startsWith("<!")) continue;
769
769
  if (value.startsWith("</")) {
770
770
  const tagName = value.slice(2, -1).trim().toLowerCase();
771
771
  while (stack.length > 1) if (stack.pop()?.tagName === tagName) break;
package/dist/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import { c as htmlTarget, d as loadConfig, f as validateConfig, l as defineConfig, n as embed, r as parseHtml, s as HtmlTarget, t as applyComponentMappings, u as fromFile } from "./core-BLV62TaX.mjs";
1
+ import { c as htmlTarget, d as loadConfig, f as validateConfig, l as defineConfig, n as embed, r as parseHtml, s as HtmlTarget, t as applyComponentMappings, u as fromFile } from "./core-DSlWqRBj.mjs";
2
2
  export { HtmlTarget, applyComponentMappings, defineConfig, embed, fromFile, htmlTarget, loadConfig, parseHtml, validateConfig };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "design-embed",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "publishConfig": {
package/src/core/index.ts CHANGED
@@ -367,14 +367,16 @@ export function parseHtml(html: string): DesignNode[] {
367
367
  children: [],
368
368
  };
369
369
  const stack = [root];
370
- const tokens = html.matchAll(/<!--[\s\S]*?-->|<\/?[a-zA-Z][^>]*>|[^<]+/g);
370
+ const tokens = html.matchAll(
371
+ /<!--[\s\S]*?-->|<![A-Za-z][^>]*>|<\/?[a-zA-Z][^>]*>|[^<]+/g,
372
+ );
371
373
 
372
374
  for (const token of tokens) {
373
375
  const value = token[0];
374
376
  const offset = token.index;
375
377
  const source = getSourceLocation(html, offset);
376
378
 
377
- if (value.startsWith("<!--")) {
379
+ if (value.startsWith("<!--") || value.startsWith("<!")) {
378
380
  continue;
379
381
  }
380
382