@shikijs/rehype 3.18.0 → 3.20.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 +11 -1
  2. package/package.json +4 -4
package/dist/core.mjs CHANGED
@@ -132,7 +132,17 @@ function rehypeShikiFromHighlighter(highlighter, options) {
132
132
  };
133
133
  if (lazyLoad) {
134
134
  try {
135
- queue.push(highlighter.loadLanguage(lang).then(() => processNode(lang)));
135
+ queue.push(
136
+ highlighter.loadLanguage(lang).then(() => processNode(lang)).catch((error) => {
137
+ if (fallbackLanguage) {
138
+ processNode(fallbackLanguage);
139
+ } else if (onError) {
140
+ onError(error);
141
+ } else {
142
+ throw error;
143
+ }
144
+ })
145
+ );
136
146
  } catch (error) {
137
147
  if (fallbackLanguage)
138
148
  return processNode(fallbackLanguage);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@shikijs/rehype",
3
3
  "type": "module",
4
- "version": "3.18.0",
4
+ "version": "3.20.0",
5
5
  "description": "rehype integration for shiki",
6
6
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
7
7
  "license": "MIT",
@@ -32,15 +32,15 @@
32
32
  "hast-util-to-string": "^3.0.1",
33
33
  "unified": "^11.0.5",
34
34
  "unist-util-visit": "^5.0.0",
35
- "shiki": "3.18.0",
36
- "@shikijs/types": "3.18.0"
35
+ "@shikijs/types": "3.20.0",
36
+ "shiki": "3.20.0"
37
37
  },
38
38
  "devDependencies": {
39
39
  "rehype-raw": "^7.0.0",
40
40
  "rehype-stringify": "^10.0.1",
41
41
  "remark-parse": "^11.0.0",
42
42
  "remark-rehype": "^11.1.2",
43
- "@shikijs/transformers": "3.18.0"
43
+ "@shikijs/transformers": "3.20.0"
44
44
  },
45
45
  "scripts": {
46
46
  "build": "unbuild",