Skip to content

Commit

Permalink
chore(devtools): fix deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
harlan-zw committed Oct 15, 2024
1 parent 3f168cc commit 29864f1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions client/composables/shiki.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Highlighter, Lang } from 'shiki'
import { getHighlighter } from 'shiki'
import type { Highlighter, BundledLanguage } from 'shiki'
import { createHighlighter } from 'shiki'
import { computed, ref, toValue } from 'vue'
import type { MaybeRef } from '@vueuse/core'
import { devtools } from './rpc'
Expand All @@ -8,7 +8,7 @@ export const shiki = ref<Highlighter>()

export function loadShiki() {
// Only loading when needed
return getHighlighter({
return createHighlighter({
themes: [
'vitesse-dark',
'vitesse-light',
Expand All @@ -28,7 +28,7 @@ export function loadShiki() {
})
}

export function renderCodeHighlight(code: MaybeRef<string>, lang?: Lang) {
export function renderCodeHighlight(code: MaybeRef<string>, lang: BundledLanguage) {
return computed(() => {
const colorMode = devtools.value?.colorMode || 'light'
return shiki.value!.codeToHtml(toValue(code), {
Expand Down

0 comments on commit 29864f1

Please sign in to comment.