Fix markdown-it-katex error (#202393)
This commit is contained in:
Родитель
bb866cd345
Коммит
afbec2027b
|
@ -342,7 +342,11 @@ export const activate: ActivationFunction<void> = (ctx) => {
|
|||
}
|
||||
},
|
||||
extendMarkdownIt: (f: (md: typeof markdownIt) => void) => {
|
||||
f(markdownIt);
|
||||
try {
|
||||
f(markdownIt);
|
||||
} catch (err) {
|
||||
console.error('Error extending markdown-it', err);
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
|
|
|
@ -45,7 +45,7 @@ export async function activate(ctx: RendererContext<void>) {
|
|||
styleTemplate.content.appendChild(link);
|
||||
document.head.appendChild(styleTemplate);
|
||||
|
||||
const katex = require('@vscode/markdown-it-katex');
|
||||
const katex = require('@vscode/markdown-it-katex').default;
|
||||
const macros = {};
|
||||
markdownItRenderer.extendMarkdownIt((md: markdownIt.MarkdownIt) => {
|
||||
return md.use(katex, {
|
||||
|
|
|
@ -98,7 +98,7 @@
|
|||
"build-notebook": "node ./esbuild"
|
||||
},
|
||||
"dependencies": {
|
||||
"@vscode/markdown-it-katex": "^1.0.1"
|
||||
"@vscode/markdown-it-katex": "^1.0.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/markdown-it": "^0.0.0",
|
||||
|
|
|
@ -28,7 +28,7 @@ export function activate(context: vscode.ExtensionContext) {
|
|||
return {
|
||||
extendMarkdownIt(md: any) {
|
||||
if (isEnabled()) {
|
||||
const katex = require('@vscode/markdown-it-katex');
|
||||
const katex = require('@vscode/markdown-it-katex').default;
|
||||
const settingsMacros = getMacros();
|
||||
const options = { globalGroup: true, macros: { ...settingsMacros } };
|
||||
md.core.ruler.push('reset-katex-macros', () => {
|
||||
|
|
|
@ -12,10 +12,10 @@
|
|||
resolved "https://registry.yarnpkg.com/@types/vscode-notebook-renderer/-/vscode-notebook-renderer-1.72.0.tgz#8943dc3cef0ced2dfb1e04c0a933bd289e7d5199"
|
||||
integrity sha512-5iTjb39DpLn03ULUwrDR3L2Dy59RV4blSUHy0oLdQuIY11PhgWO4mXIcoFS0VxY1GZQ4IcjSf3ooT2Jrrcahnw==
|
||||
|
||||
"@vscode/markdown-it-katex@^1.0.1":
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/@vscode/markdown-it-katex/-/markdown-it-katex-1.0.1.tgz#79c6e7312074e1f897cc22c42ce078d1e72003b0"
|
||||
integrity sha512-O/HiT5Uc6rN6rSx8tDdgwO1tLSn/lrNeikTzYw1EBG6B2IGLKw4I4e/GBh9DRNSdE9PajCA0tsVBz86qyA7B3A==
|
||||
"@vscode/markdown-it-katex@^1.0.2":
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/@vscode/markdown-it-katex/-/markdown-it-katex-1.0.2.tgz#27ba579fa3896b2944b71209dd30d0f983983f11"
|
||||
integrity sha512-QY/OnOHPTqc8tQoCoAjVblILX4yE6xGZHKODtiTKqA328OXra+lSpeJO5Ouo9AAvrs9AwcCLz6xvW3zwcsPBQg==
|
||||
dependencies:
|
||||
katex "^0.16.4"
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче