@shikijs/vitepress-twoslash 1.2.4 → 1.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 +14 -8
  2. package/package.json +3 -3
package/dist/index.mjs CHANGED
@@ -135,14 +135,20 @@ function renderMarkdown(md) {
135
135
  code: (state, node) => {
136
136
  const lang = node.lang || "";
137
137
  if (lang) {
138
- return this.codeToHast(
139
- node.value,
140
- {
141
- ...this.options,
142
- transformers: [],
143
- lang
144
- }
145
- ).children[0];
138
+ return {
139
+ type: "element",
140
+ tagName: "code",
141
+ properties: {},
142
+ children: this.codeToHast(
143
+ node.value,
144
+ {
145
+ ...this.options,
146
+ transformers: [],
147
+ lang,
148
+ structure: "inline"
149
+ }
150
+ ).children
151
+ };
146
152
  }
147
153
  return defaultHandlers.code(state, node);
148
154
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@shikijs/vitepress-twoslash",
3
3
  "type": "module",
4
- "version": "1.2.4",
4
+ "version": "1.3.0",
5
5
  "description": "Enable Twoslash support in VitePress",
6
6
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
7
7
  "license": "MIT",
@@ -55,8 +55,8 @@
55
55
  "twoslash": "^0.2.5",
56
56
  "twoslash-vue": "^0.2.5",
57
57
  "vue": "^3.4.21",
58
- "@shikijs/twoslash": "1.2.4",
59
- "shiki": "1.2.4"
58
+ "@shikijs/twoslash": "1.3.0",
59
+ "shiki": "1.3.0"
60
60
  },
61
61
  "scripts": {
62
62
  "build": "unbuild",