File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 1
- import type { Highlighter , Lang } from 'shiki'
2
- import { getHighlighter } from 'shiki'
1
+ import type { Highlighter , BundledLanguage } from 'shiki'
2
+ import { createHighlighter } from 'shiki'
3
3
import { computed , ref , toValue } from 'vue'
4
4
import type { MaybeRef } from '@vueuse/core'
5
5
import { devtools } from './rpc'
@@ -8,7 +8,7 @@ export const shiki = ref<Highlighter>()
8
8
9
9
export function loadShiki ( ) {
10
10
// Only loading when needed
11
- return getHighlighter ( {
11
+ return createHighlighter ( {
12
12
themes : [
13
13
'vitesse-dark' ,
14
14
'vitesse-light' ,
@@ -28,7 +28,7 @@ export function loadShiki() {
28
28
} )
29
29
}
30
30
31
- export function renderCodeHighlight ( code : MaybeRef < string > , lang ?: Lang ) {
31
+ export function renderCodeHighlight ( code : MaybeRef < string > , lang : BundledLanguage ) {
32
32
return computed ( ( ) => {
33
33
const colorMode = devtools . value ?. colorMode || 'light'
34
34
return shiki . value ! . codeToHtml ( toValue ( code ) , {
You can’t perform that action at this time.
0 commit comments