Skip to content

Commit b283772

Browse files
authored
feat: import highlight core only (#402)
* feat: import highlight core only * feat: improve Hljs types
1 parent 35169b4 commit b283772

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/markdownRender/extensions/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1-
import hljs from 'highlight.js';
1+
import type * as Hljs from 'highlight.js';
2+
import hljsCore from 'highlight.js/lib/core';
23
import sql from 'highlight.js/lib/languages/sql';
34
import showdown from 'showdown';
45

56
import 'highlight.js/styles/default.css';
67
import '../theme/vs.scss';
78
import '../theme/vs-dark.scss';
89

10+
const hljs = hljsCore as typeof Hljs;
11+
912
hljs.registerLanguage('sql', sql);
1013

1114
export default function sqlHighlightExtension(): showdown.ShowdownExtension {

0 commit comments

Comments
 (0)