add highlight option for demos

This commit is contained in:
Philipp Kühn
2020-08-12 09:37:15 +02:00
parent 6d1a333171
commit eeac0fce37
8 changed files with 76 additions and 15 deletions

View File

@@ -11,7 +11,4 @@ export default function (Vue, { router, head, isClient }) {
Vue.component('Demo', Demo)
Vue.component('Tab', Tab)
Vue.component('ReactRenderer', ReactRenderer)
Vue.filter('highlight', (code, lang = 'javascript') => {
return Prism.highlight(code, Prism.languages[lang], lang)
})
}