@shikijs/transformers 1.24.2 → 1.24.4
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 +3 -4
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -33,11 +33,10 @@ function transformerMetaHighlight(options = {}) {
|
|
|
33
33
|
return {
|
|
34
34
|
name: "@shikijs/transformers:meta-highlight",
|
|
35
35
|
line(node, line) {
|
|
36
|
-
var _a;
|
|
37
36
|
if (!this.options.meta?.__raw) {
|
|
38
37
|
return;
|
|
39
38
|
}
|
|
40
|
-
|
|
39
|
+
this.meta[symbol] ||= parseMetaHighlightString(this.options.meta.__raw);
|
|
41
40
|
const lines = this.meta[symbol] || [];
|
|
42
41
|
if (lines.includes(line))
|
|
43
42
|
this.addClassToHast(node, className);
|
|
@@ -62,7 +61,7 @@ function transformerMetaWordHighlight(options = {}) {
|
|
|
62
61
|
if (!this.options.meta?.__raw)
|
|
63
62
|
return;
|
|
64
63
|
const words = parseMetaHighlightWords(this.options.meta.__raw);
|
|
65
|
-
options2.decorations
|
|
64
|
+
options2.decorations ||= [];
|
|
66
65
|
for (const word of words) {
|
|
67
66
|
const indexes = findAllSubstringIndexes(code, word);
|
|
68
67
|
for (const index of indexes) {
|
|
@@ -478,7 +477,7 @@ function transformerStyleToClass(options = {}) {
|
|
|
478
477
|
continue;
|
|
479
478
|
const className = registerStyle(token.htmlStyle);
|
|
480
479
|
token.htmlStyle = {};
|
|
481
|
-
token.htmlAttrs
|
|
480
|
+
token.htmlAttrs ||= {};
|
|
482
481
|
if (!token.htmlAttrs.class)
|
|
483
482
|
token.htmlAttrs.class = className;
|
|
484
483
|
else
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shikijs/transformers",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.24.
|
|
4
|
+
"version": "1.24.4",
|
|
5
5
|
"description": "Collective of common transformers transformers for Shiki",
|
|
6
6
|
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"dist"
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"shiki": "1.24.
|
|
33
|
+
"shiki": "1.24.4"
|
|
34
34
|
},
|
|
35
35
|
"scripts": {
|
|
36
36
|
"build": "unbuild",
|