@shikijs/core 2.1.0 → 2.3.0

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.
Files changed (2) hide show
  1. package/dist/index.mjs +6 -7
  2. package/package.json +4 -4
package/dist/index.mjs CHANGED
@@ -384,7 +384,7 @@ function transformerDecorations() {
384
384
  return el;
385
385
  }
386
386
  const lineApplies = [];
387
- const sorted = ctx.decorations.sort((a, b) => b.start.offset - a.start.offset);
387
+ const sorted = ctx.decorations.sort((a, b) => b.start.offset - a.start.offset || a.end.offset - b.end.offset);
388
388
  for (const decoration of sorted) {
389
389
  const { start, end } = decoration;
390
390
  if (start.line === end.line) {
@@ -407,12 +407,12 @@ function verifyIntersections(items) {
407
407
  throw new ShikiError(`Invalid decoration range: ${JSON.stringify(foo.start)} - ${JSON.stringify(foo.end)}`);
408
408
  for (let j = i + 1; j < items.length; j++) {
409
409
  const bar = items[j];
410
- const isFooHasBarStart = foo.start.offset < bar.start.offset && bar.start.offset < foo.end.offset;
411
- const isFooHasBarEnd = foo.start.offset < bar.end.offset && bar.end.offset < foo.end.offset;
412
- const isBarHasFooStart = bar.start.offset < foo.start.offset && foo.start.offset < bar.end.offset;
413
- const isBarHasFooEnd = bar.start.offset < foo.end.offset && foo.end.offset < bar.end.offset;
410
+ const isFooHasBarStart = foo.start.offset <= bar.start.offset && bar.start.offset < foo.end.offset;
411
+ const isFooHasBarEnd = foo.start.offset < bar.end.offset && bar.end.offset <= foo.end.offset;
412
+ const isBarHasFooStart = bar.start.offset <= foo.start.offset && foo.start.offset < bar.end.offset;
413
+ const isBarHasFooEnd = bar.start.offset < foo.end.offset && foo.end.offset <= bar.end.offset;
414
414
  if (isFooHasBarStart || isFooHasBarEnd || isBarHasFooStart || isBarHasFooEnd) {
415
- if (isFooHasBarEnd && isFooHasBarEnd)
415
+ if (isFooHasBarStart && isFooHasBarEnd)
416
416
  continue;
417
417
  if (isBarHasFooStart && isBarHasFooEnd)
418
418
  continue;
@@ -1789,7 +1789,6 @@ async function createShikiInternal(options) {
1789
1789
  ]);
1790
1790
  return createShikiInternalSync({
1791
1791
  ...options,
1792
- loadWasm: undefined,
1793
1792
  themes,
1794
1793
  langs,
1795
1794
  engine
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@shikijs/core",
3
3
  "type": "module",
4
- "version": "2.1.0",
4
+ "version": "2.3.0",
5
5
  "description": "Core of Shiki",
6
6
  "author": "Pine Wu <octref@gmail.com>; Anthony Fu <anthonyfu117@hotmail.com>",
7
7
  "license": "MIT",
@@ -63,9 +63,9 @@
63
63
  "@shikijs/vscode-textmate": "^10.0.1",
64
64
  "@types/hast": "^3.0.4",
65
65
  "hast-util-to-html": "^9.0.4",
66
- "@shikijs/engine-javascript": "2.1.0",
67
- "@shikijs/engine-oniguruma": "2.1.0",
68
- "@shikijs/types": "2.1.0"
66
+ "@shikijs/engine-javascript": "2.3.0",
67
+ "@shikijs/types": "2.3.0",
68
+ "@shikijs/engine-oniguruma": "2.3.0"
69
69
  },
70
70
  "scripts": {
71
71
  "build": "unbuild",