@shikijs/core 3.9.0 → 3.9.2
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.mjs +6 -2
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -320,11 +320,15 @@ function transformerDecorations() {
|
|
|
320
320
|
const line = converter.lines[p.line];
|
|
321
321
|
if (line === void 0)
|
|
322
322
|
throw new ShikiError$1(`Invalid decoration position ${JSON.stringify(p)}. Lines length: ${converter.lines.length}`);
|
|
323
|
-
|
|
323
|
+
let character = p.character;
|
|
324
|
+
if (character < 0)
|
|
325
|
+
character = line.length + character;
|
|
326
|
+
if (character < 0 || character > line.length)
|
|
324
327
|
throw new ShikiError$1(`Invalid decoration position ${JSON.stringify(p)}. Line ${p.line} length: ${line.length}`);
|
|
325
328
|
return {
|
|
326
329
|
...p,
|
|
327
|
-
|
|
330
|
+
character,
|
|
331
|
+
offset: converter.posToIndex(p.line, character)
|
|
328
332
|
};
|
|
329
333
|
}
|
|
330
334
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shikijs/core",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "3.9.
|
|
4
|
+
"version": "3.9.2",
|
|
5
5
|
"description": "Core of Shiki",
|
|
6
6
|
"author": "Pine Wu <octref@gmail.com>; Anthony Fu <anthonyfu117@hotmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"@shikijs/vscode-textmate": "^10.0.2",
|
|
40
40
|
"@types/hast": "^3.0.4",
|
|
41
41
|
"hast-util-to-html": "^9.0.5",
|
|
42
|
-
"@shikijs/types": "3.9.
|
|
42
|
+
"@shikijs/types": "3.9.2"
|
|
43
43
|
},
|
|
44
44
|
"scripts": {
|
|
45
45
|
"build": "unbuild",
|