diff --git a/ui/plugin-katex/package.json b/ui/plugin-katex/package.json index 3c4a0acb..14dd5663 100644 --- a/ui/plugin-katex/package.json +++ b/ui/plugin-katex/package.json @@ -1,6 +1,6 @@ { "name": "@artalk/plugin-katex", - "version": "0.2.2", + "version": "0.2.3", "minAppVersion": "2.8.6", "license": "MIT", "description": "The katex plugin for artalk", diff --git a/ui/plugin-katex/src/main.ts b/ui/plugin-katex/src/main.ts index 6de86d83..1758838a 100644 --- a/ui/plugin-katex/src/main.ts +++ b/ui/plugin-katex/src/main.ts @@ -75,6 +75,13 @@ export const ArtalkKatexPlugin: ArtalkPlugin = (ctx) => { return } + if (typeof katex === 'undefined') { + console.error( + '[artalk-plugin-katex] katex not found, please make sure you have imported katex in your project', + ) + return + } + markedInstance.use({ extensions: [blockMathExtension, inlineMathExtension], })