@shikijs/rehype 2.3.1 → 2.4.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/core.mjs +3 -3
  2. package/package.json +4 -4
package/dist/core.mjs CHANGED
@@ -24,10 +24,10 @@ const PreHandler = (_tree, node) => {
24
24
  const classes = head.properties.className;
25
25
  const languageClass = Array.isArray(classes) ? classes.find(
26
26
  (d) => typeof d === "string" && d.startsWith(languagePrefix$1)
27
- ) : undefined;
27
+ ) : void 0;
28
28
  return {
29
29
  type: "pre",
30
- lang: typeof languageClass === "string" ? languageClass.slice(languagePrefix$1.length) : undefined,
30
+ lang: typeof languageClass === "string" ? languageClass.slice(languagePrefix$1.length) : void 0,
31
31
  code: toString(head),
32
32
  meta: head.data?.meta ?? head.properties.metastring?.toString() ?? ""
33
33
  };
@@ -117,7 +117,7 @@ function rehypeShikiFromHighlighter(highlighter, options) {
117
117
  }
118
118
  if (!lang)
119
119
  return;
120
- const meta = parsed.meta ? parseMetaString?.(parsed.meta, node, tree) : undefined;
120
+ const meta = parsed.meta ? parseMetaString?.(parsed.meta, node, tree) : void 0;
121
121
  const processNode = (targetLang) => {
122
122
  const fragment = highlight(targetLang, parsed.code, parsed.meta, meta ?? {});
123
123
  if (!fragment)
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@shikijs/rehype",
3
3
  "type": "module",
4
- "version": "2.3.1",
4
+ "version": "2.4.0",
5
5
  "description": "rehype integration for shiki",
6
6
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
7
7
  "license": "MIT",
@@ -49,15 +49,15 @@
49
49
  "hast-util-to-string": "^3.0.1",
50
50
  "unified": "^11.0.5",
51
51
  "unist-util-visit": "^5.0.0",
52
- "@shikijs/types": "2.3.1",
53
- "shiki": "2.3.1"
52
+ "@shikijs/types": "2.4.0",
53
+ "shiki": "2.4.0"
54
54
  },
55
55
  "devDependencies": {
56
56
  "rehype-raw": "^7.0.0",
57
57
  "rehype-stringify": "^10.0.1",
58
58
  "remark-parse": "^11.0.0",
59
59
  "remark-rehype": "^11.1.1",
60
- "@shikijs/transformers": "2.3.1"
60
+ "@shikijs/transformers": "2.4.0"
61
61
  },
62
62
  "scripts": {
63
63
  "build": "unbuild",