vitepress
vitepress copied to clipboard
Shiki code extensions not working when using a different theme than default
trafficstars
Describe the bug
The feature allowing // [!code --], // [!code focus] etc is seemingly disabled when the theme isn't the default "github" theme from Shiki.
Reproduction
Add a theme to the markdown configuration:
markdown: {
theme: { dark: "rose-pine", light: "rose-pine-dawn" },
}
And add a code block with a transformation
```js
export default {
data () {
return {
msg: 'Removed' // [!code --]
msg: 'Added' // [!code ++]
}
}
}
```
Expected behavior
The effects work with other themes other than the default one
System Info
System:
OS: Windows 11 10.0.22631
CPU: (32) x64 AMD Ryzen 9 7950X 16-Core Processor
Memory: 33.50 GB / 63.14 GB
Binaries:
Node: 20.15.0 - ~\AppData\Local\fnm_multishells\736048_1722274229696\node.EXE
npm: 10.7.0 - ~\AppData\Local\fnm_multishells\736048_1722274229696\npm.CMD
Browsers:
Edge: Chromium (127.0.2651.74)
Internet Explorer: 11.0.22621.3527
Firefox: 128.0.3
Additional context
No response
Validations
- [X] Check if you're on the latest VitePress version.
- [X] Follow our Code of Conduct
- [X] Read the docs.
- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Something seems wrong with rose-pine related themes. Other themes are working fine.
Linking discussion on #4248 for reference.
It's same as #3503 (https://github.com/antfu/shikiji/issues/110#issuecomment-1912281613). Please create an issue at https://github.com/shikijs/shiki.
Duplicate of #3503