File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
routes/docs/_components/highlight Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -67,8 +67,7 @@ export default component$(() => {
67
67
type = "module"
68
68
dangerouslySetInnerHTML = {
69
69
/*javascript*/ `
70
- import * as shikiji from 'https://esm.sh/[email protected] '
71
- window.shikiji = shikiji;
70
+ window.shikiji = import('https://esm.sh/[email protected] ');
72
71
`
73
72
}
74
73
/>
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ export const Highlight = component$(
28
28
const codeSig = useSignal ( '' ) ;
29
29
30
30
useVisibleTask$ ( async function createHighlightedCode ( ) {
31
+ const highlighter = await ( window as any ) . shikiji ;
31
32
let modifiedCode : string = code ;
32
33
33
34
let partsOfCode = modifiedCode . split ( splitCommentStart ) ;
@@ -40,7 +41,7 @@ export const Highlight = component$(
40
41
modifiedCode = partsOfCode [ 0 ] ;
41
42
}
42
43
43
- const str = await ( window as any ) . shikiji . codeToHtml ( modifiedCode , {
44
+ const str = await highlighter . codeToHtml ( modifiedCode , {
44
45
lang : language ,
45
46
themes : {
46
47
light : 'vitesse-light' ,
You can’t perform that action at this time.
0 commit comments