Skip to content

Commit f124c95

Browse files
committed
fix(shiki): inline codes syntax highlighting
1 parent 2caa486 commit f124c95

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

playground/content/0.index.md

+2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ date: 2024-09-23
1919
- [post](/real-content/post)
2020
- [query](/real-content/query)
2121

22+
Inline code: `const a = 1`{lang="ts"}
23+
2224
In order to test [Tailwind CSS]{.text-orange-500}, uncomment `@nuxtjs/tailwindcss` in `nuxt.config.ts`.
2325

2426
```vue [app.vue]

src/utils/content/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ async function _getHighlightPlugin(options: HighlighterOptions) {
8787
},
8888
)
8989

90-
result.style = Object.entries(stylesMap).map(([style, cls]) => `html pre.shiki code .${cls}{${style}}`).join('') + result.style
90+
result.style = Object.entries(stylesMap).map(([style, cls]) => `html pre.shiki code .${cls}, html code.shiki .${cls}{${style}}`).join('') + result.style
9191
}
9292

9393
return result

0 commit comments

Comments
 (0)