11import React , { useMemo , useState , useEffect , useCallback } from 'react'
22import EventEmitter3 from 'eventemitter3'
3- import { getHighlighter } from 'shikiji'
43import ClipboardJS from 'clipboard'
54import { render } from 'react-dom'
65import DOMPurify from 'dompurify'
76import { html } from 'htm/react'
7+ import halfmoon from 'halfmoon'
88import slugify from 'slugify'
99import marked from 'marked'
10- import halfmoon from 'halfmoon'
1110
11+ // Syntax highlighting imports
12+ import { getHighlighterCore } from 'shikiji/core'
13+ import dracula from 'shikiji/themes/dracula.mjs'
14+ import { getWasmInlined } from 'shikiji/wasm'
15+ import yaml from 'shikiji/langs/yaml.mjs'
16+
17+ const supportedLangs = [ 'yaml' ] ;
1218const bus = new EventEmitter3 ( ) ;
1319window . bus = bus ;
1420
@@ -20,11 +26,10 @@ clipboard.on('success', e => {
2026 } )
2127} ) ;
2228
23- // const supportedLangs = ['yaml', 'shell', 'rust'];
24- const supportedLangs = [ 'yaml' ] ;
25- const highlighter = await getHighlighter ( {
26- themes : [ 'dracula' ] ,
27- langs : supportedLangs ,
29+ const highlighter = await getHighlighterCore ( {
30+ loadWasm : getWasmInlined ,
31+ themes : [ dracula ] ,
32+ langs : [ yaml ] ,
2833} )
2934
3035marked . use ( {
0 commit comments