Skip to content

Commit

Permalink
fix(shiki): inline codes syntax highlighting
Browse files Browse the repository at this point in the history
  • Loading branch information
farnabaz committed Dec 16, 2024
1 parent 2caa486 commit f124c95
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions playground/content/0.index.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ date: 2024-09-23
- [post](/real-content/post)
- [query](/real-content/query)

Inline code: `const a = 1`{lang="ts"}

In order to test [Tailwind CSS]{.text-orange-500}, uncomment `@nuxtjs/tailwindcss` in `nuxt.config.ts`.

```vue [app.vue]
Expand Down
2 changes: 1 addition & 1 deletion src/utils/content/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ async function _getHighlightPlugin(options: HighlighterOptions) {
},
)

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

return result
Expand Down

0 comments on commit f124c95

Please sign in to comment.