Skip to content

Commit

Permalink
chore: update
Browse files Browse the repository at this point in the history
  • Loading branch information
Mister-Hope committed Jan 12, 2025
1 parent fb37a44 commit de74ee5
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 15 deletions.
2 changes: 1 addition & 1 deletion plugins/markdown/plugin-markdown-math/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"style": "sass src:lib --embed-sources --style=compressed"
},
"dependencies": {
"@mdit/plugin-katex-slim": "^0.16.0",
"@mdit/plugin-katex-slim": "^0.16.1",
"@mdit/plugin-mathjax-slim": "^0.16.0",
"@types/markdown-it": "^14.1.2",
"@vuepress/helper": "workspace:*",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type { MarkdownItKatexOptions } from '@mdit/plugin-katex-slim'
import { katex } from '@mdit/plugin-katex-slim'
import type { MathjaxInstance } from '@mdit/plugin-mathjax-slim'
import { createMathjaxInstance, mathjax } from '@mdit/plugin-mathjax-slim'
import { addCustomElement, isModuleAvailable } from '@vuepress/helper'
import type { Plugin } from 'vuepress/core'
Expand Down Expand Up @@ -68,7 +67,7 @@ export const markdownMathPlugin = ({

extendsMarkdown: (md) => {
if (mathRenderer === 'mathjax') {
md.use<MathjaxInstance>(mathjax, mathjaxInstance!)
md.use(mathjax, mathjaxInstance)
// Reset mathjax style in each render
md.use((mdIt) => {
const originalRender = mdIt.render.bind(mdIt)
Expand All @@ -83,7 +82,12 @@ export const markdownMathPlugin = ({
})
} else {
md.use<MarkdownItKatexOptions<MarkdownEnv>>(katex, {
logger: (errorCode, errorMsg, token, { filePathRelative }) => {
logger: (
errorCode,
errorMsg,
token,
{ filePathRelative },
): undefined => {
// Ignore this error
if (errorCode === 'newLineInDisplayMode') return

Expand Down
2 changes: 1 addition & 1 deletion plugins/markdown/plugin-markdown-stylize/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
},
"dependencies": {
"@mdit/plugin-align": "^0.16.0",
"@mdit/plugin-attrs": "^0.16.0",
"@mdit/plugin-attrs": "^0.16.1",
"@mdit/plugin-mark": "^0.16.0",
"@mdit/plugin-spoiler": "^0.16.0",
"@mdit/plugin-stylize": "^0.16.0",
Expand Down
20 changes: 10 additions & 10 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit de74ee5

Please sign in to comment.