@vectojs/markdown 0.16.0 → 0.16.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/index.js CHANGED
@@ -1443,6 +1443,18 @@ function collectSpans(tokens, inherited, theme, out, blockFontSize) {
1443
1443
  }
1444
1444
  case "del": {
1445
1445
  const t = token;
1446
+ const isStrikethrough = t.raw?.startsWith("~~") ?? true;
1447
+ if (!isStrikethrough) {
1448
+ const plain = Object.keys(inherited).length > 0 ? inherited : void 0;
1449
+ out.push({ text: "~", style: plain });
1450
+ if (t.tokens) {
1451
+ collectSpans(t.tokens, inherited, theme, out, blockFontSize);
1452
+ } else {
1453
+ out.push({ text: decodeEntities(t.text), style: plain });
1454
+ }
1455
+ out.push({ text: "~", style: plain });
1456
+ break;
1457
+ }
1446
1458
  if (t.tokens) {
1447
1459
  collectSpans(t.tokens, { ...inherited, lineThrough: true }, theme, out, blockFontSize);
1448
1460
  } else {
package/dist/index.mjs CHANGED
@@ -1400,6 +1400,18 @@ function collectSpans(tokens, inherited, theme, out, blockFontSize) {
1400
1400
  }
1401
1401
  case "del": {
1402
1402
  const t = token;
1403
+ const isStrikethrough = t.raw?.startsWith("~~") ?? true;
1404
+ if (!isStrikethrough) {
1405
+ const plain = Object.keys(inherited).length > 0 ? inherited : void 0;
1406
+ out.push({ text: "~", style: plain });
1407
+ if (t.tokens) {
1408
+ collectSpans(t.tokens, inherited, theme, out, blockFontSize);
1409
+ } else {
1410
+ out.push({ text: decodeEntities(t.text), style: plain });
1411
+ }
1412
+ out.push({ text: "~", style: plain });
1413
+ break;
1414
+ }
1403
1415
  if (t.tokens) {
1404
1416
  collectSpans(t.tokens, { ...inherited, lineThrough: true }, theme, out, blockFontSize);
1405
1417
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vectojs/markdown",
3
- "version": "0.16.0",
3
+ "version": "0.16.1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -41,7 +41,7 @@
41
41
  "scripts": {
42
42
  "build": "(cd ../ui && bun run build) && (cd ../tex && bun run build) && node scripts/build-worker.js && tsup src/index.ts --format cjs,esm --clean && tsc -p tsconfig.build.json",
43
43
  "test": "vitest run",
44
- "test:e2e": "bun e2e/blockquote-layout.e2e.ts && bun e2e/stream-controller.e2e.ts && bun e2e/lazy-math.e2e.ts && bun e2e/paragraph-image-repaint.e2e.ts && bun e2e/inline-image.e2e.ts && bun e2e/selection-fidelity.e2e.ts && bun e2e/code-atlas-dpr.e2e.ts && bun e2e/set-max-width.e2e.ts && bun e2e/block-affordances.e2e.ts"
44
+ "test:e2e": "bun e2e/blockquote-layout.e2e.ts && bun e2e/stream-controller.e2e.ts && bun e2e/lazy-math.e2e.ts && bun e2e/paragraph-image-repaint.e2e.ts && bun e2e/inline-image.e2e.ts && bun e2e/selection-fidelity.e2e.ts && bun e2e/code-atlas-dpr.e2e.ts && bun e2e/set-max-width.e2e.ts && bun e2e/block-affordances.e2e.ts && bun e2e/single-tilde-ink.e2e.ts"
45
45
  },
46
46
  "dependencies": {
47
47
  "@vectojs/tex": "^0.1.0",