Skip to content

Commit

Permalink
perf(plugin_katex): add error message for missing katex deps
Browse files Browse the repository at this point in the history
  • Loading branch information
qwqcode committed Sep 17, 2024
1 parent 2a49c0e commit 7ffaa04
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ui/plugin-katex/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
7 changes: 7 additions & 0 deletions ui/plugin-katex/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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],
})
Expand Down

0 comments on commit 7ffaa04

Please sign in to comment.