fix: replace cssVariables to highlight
This commit is contained in:
parent
52b9b20b3c
commit
b1ed24f61d
|
|
@ -2,10 +2,9 @@
|
||||||
import { useConfigStore } from '@/stores/config'
|
import { useConfigStore } from '@/stores/config'
|
||||||
import { CircleHelp, Info, Monitor, Smartphone, Tablet } from 'lucide-vue-next'
|
import { CircleHelp, Info, Monitor, Smartphone, Tablet } from 'lucide-vue-next'
|
||||||
import MagicString from 'magic-string'
|
import MagicString from 'magic-string'
|
||||||
import { codeToHtml } from 'shiki'
|
|
||||||
import { reactive, ref, watch } from 'vue'
|
import { reactive, ref, watch } from 'vue'
|
||||||
import { compileScript, parse, walk } from 'vue/compiler-sfc'
|
import { compileScript, parse, walk } from 'vue/compiler-sfc'
|
||||||
import { cssVariables } from '../config/shiki'
|
import { highlight } from '../config/shiki'
|
||||||
import BlockCopyButton from './BlockCopyButton.vue'
|
import BlockCopyButton from './BlockCopyButton.vue'
|
||||||
import StyleSwitcher from './StyleSwitcher.vue'
|
import StyleSwitcher from './StyleSwitcher.vue'
|
||||||
|
|
||||||
|
|
@ -79,10 +78,7 @@ watch([style, codeConfig], async () => {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
codeHtml.value = await codeToHtml(rawString.value, {
|
codeHtml.value = highlight(rawString.value, 'vue')
|
||||||
lang: 'vue',
|
|
||||||
theme: cssVariables,
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
console.error(err)
|
console.error(err)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user