File tree Expand file tree Collapse file tree 5 files changed +12
-8
lines changed
markdown-language-features/notebook Expand file tree Collapse file tree 5 files changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -342,7 +342,11 @@ export const activate: ActivationFunction<void> = (ctx) => {
342
342
}
343
343
} ,
344
344
extendMarkdownIt : ( f : ( md : typeof markdownIt ) => void ) => {
345
- f ( markdownIt ) ;
345
+ try {
346
+ f ( markdownIt ) ;
347
+ } catch ( err ) {
348
+ console . error ( 'Error extending markdown-it' , err ) ;
349
+ }
346
350
}
347
351
} ;
348
352
} ;
Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ export async function activate(ctx: RendererContext<void>) {
45
45
styleTemplate . content . appendChild ( link ) ;
46
46
document . head . appendChild ( styleTemplate ) ;
47
47
48
- const katex = require ( '@vscode/markdown-it-katex' ) ;
48
+ const katex = require ( '@vscode/markdown-it-katex' ) . default ;
49
49
const macros = { } ;
50
50
markdownItRenderer . extendMarkdownIt ( ( md : markdownIt . MarkdownIt ) => {
51
51
return md . use ( katex , {
Original file line number Diff line number Diff line change 98
98
"build-notebook" : " node ./esbuild"
99
99
},
100
100
"dependencies" : {
101
- "@vscode/markdown-it-katex" : " ^1.0.1 "
101
+ "@vscode/markdown-it-katex" : " ^1.0.2 "
102
102
},
103
103
"devDependencies" : {
104
104
"@types/markdown-it" : " ^0.0.0" ,
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ export function activate(context: vscode.ExtensionContext) {
28
28
return {
29
29
extendMarkdownIt ( md : any ) {
30
30
if ( isEnabled ( ) ) {
31
- const katex = require ( '@vscode/markdown-it-katex' ) ;
31
+ const katex = require ( '@vscode/markdown-it-katex' ) . default ;
32
32
const settingsMacros = getMacros ( ) ;
33
33
const options = { globalGroup : true , macros : { ...settingsMacros } } ;
34
34
md . core . ruler . push ( 'reset-katex-macros' , ( ) => {
Original file line number Diff line number Diff line change 12
12
resolved "https://registry.yarnpkg.com/@types/vscode-notebook-renderer/-/vscode-notebook-renderer-1.72.0.tgz#8943dc3cef0ced2dfb1e04c0a933bd289e7d5199"
13
13
integrity sha512-5iTjb39DpLn03ULUwrDR3L2Dy59RV4blSUHy0oLdQuIY11PhgWO4mXIcoFS0VxY1GZQ4IcjSf3ooT2Jrrcahnw==
14
14
15
- " @vscode/markdown-it-katex@^1.0.1 " :
16
- version "1.0.1 "
17
- resolved "https://registry.yarnpkg.com/@vscode/markdown-it-katex/-/markdown-it-katex-1.0.1 .tgz#79c6e7312074e1f897cc22c42ce078d1e72003b0 "
18
- integrity sha512-O/HiT5Uc6rN6rSx8tDdgwO1tLSn/lrNeikTzYw1EBG6B2IGLKw4I4e/GBh9DRNSdE9PajCA0tsVBz86qyA7B3A ==
15
+ " @vscode/markdown-it-katex@^1.0.2 " :
16
+ version "1.0.2 "
17
+ resolved "https://registry.yarnpkg.com/@vscode/markdown-it-katex/-/markdown-it-katex-1.0.2 .tgz#27ba579fa3896b2944b71209dd30d0f983983f11 "
18
+ integrity sha512-QY/OnOHPTqc8tQoCoAjVblILX4yE6xGZHKODtiTKqA328OXra+lSpeJO5Ouo9AAvrs9AwcCLz6xvW3zwcsPBQg ==
19
19
dependencies :
20
20
katex "^0.16.4"
21
21
You can’t perform that action at this time.
0 commit comments