perf: change katex package

This commit is contained in:
ChenZhoYu 2024-05-16 09:38:50 +08:00
parent a4103769ce
commit ab9dca471d
3 changed files with 13 additions and 13 deletions

View File

@ -23,7 +23,7 @@
"common:prepare": "husky install" "common:prepare": "husky install"
}, },
"dependencies": { "dependencies": {
"@traptitech/markdown-it-katex": "^3.6.0", "@vscode/markdown-it-katex": "^1.0.3",
"@vueuse/core": "^9.13.0", "@vueuse/core": "^9.13.0",
"highlight.js": "^11.7.0", "highlight.js": "^11.7.0",
"html-to-image": "^1.11.11", "html-to-image": "^1.11.11",

View File

@ -8,9 +8,9 @@ importers:
.: .:
dependencies: dependencies:
'@traptitech/markdown-it-katex': '@vscode/markdown-it-katex':
specifier: ^3.6.0 specifier: ^1.0.3
version: 3.6.0 version: 1.0.3
'@vueuse/core': '@vueuse/core':
specifier: ^9.13.0 specifier: ^9.13.0
version: 9.13.0(vue@3.2.47) version: 9.13.0(vue@3.2.47)
@ -1115,9 +1115,6 @@ packages:
'@surma/rollup-plugin-off-main-thread@2.2.3': '@surma/rollup-plugin-off-main-thread@2.2.3':
resolution: {integrity: sha512-lR8q/9W7hZpMWweNiAKU7NQerBnzQQLvi8qnTDU/fxItPhtZVMbPV3lbCwjhIlNBe9Bbr5V+KHshvWmVSG9cxQ==} resolution: {integrity: sha512-lR8q/9W7hZpMWweNiAKU7NQerBnzQQLvi8qnTDU/fxItPhtZVMbPV3lbCwjhIlNBe9Bbr5V+KHshvWmVSG9cxQ==}
'@traptitech/markdown-it-katex@3.6.0':
resolution: {integrity: sha512-CnJzTWxsgLGXFdSrWRaGz7GZ1kUUi8g3E9HzJmeveX1YwVJavrKYqysktfHZQsujdnRqV5O7g8FPKEA/aeTkOQ==}
'@tsconfig/node10@1.0.9': '@tsconfig/node10@1.0.9':
resolution: {integrity: sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==} resolution: {integrity: sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==}
@ -1279,6 +1276,9 @@ packages:
'@volar/vue-typescript@1.2.0': '@volar/vue-typescript@1.2.0':
resolution: {integrity: sha512-zjmRi9y3J1EkG+pfuHp8IbHmibihrKK485cfzsHjiuvJMGrpkWvlO5WVEk8oslMxxeGC5XwBFE9AOlvh378EPA==} resolution: {integrity: sha512-zjmRi9y3J1EkG+pfuHp8IbHmibihrKK485cfzsHjiuvJMGrpkWvlO5WVEk8oslMxxeGC5XwBFE9AOlvh378EPA==}
'@vscode/markdown-it-katex@1.0.3':
resolution: {integrity: sha512-a8ppdac0CG2lAQC6E6lT8dxmXkUk9gRtYNtILx31FyrPEwj875AAHc6tpRGeJBpWMpiMtcvz7ymWYBwYgxuFmw==}
'@vue/compiler-core@3.2.47': '@vue/compiler-core@3.2.47':
resolution: {integrity: sha512-p4D7FDnQb7+YJmO2iPEv0SQNeNzcbHdGByJDsT4lynf63AFkOTFN07HsiRSvjGo0QrxR/o3d0hUyNCUnBU2Tig==} resolution: {integrity: sha512-p4D7FDnQb7+YJmO2iPEv0SQNeNzcbHdGByJDsT4lynf63AFkOTFN07HsiRSvjGo0QrxR/o3d0hUyNCUnBU2Tig==}
@ -5095,10 +5095,6 @@ snapshots:
magic-string: 0.25.9 magic-string: 0.25.9
string.prototype.matchall: 4.0.10 string.prototype.matchall: 4.0.10
'@traptitech/markdown-it-katex@3.6.0':
dependencies:
katex: 0.16.4
'@tsconfig/node10@1.0.9': {} '@tsconfig/node10@1.0.9': {}
'@tsconfig/node12@1.0.11': {} '@tsconfig/node12@1.0.11': {}
@ -5284,6 +5280,10 @@ snapshots:
'@volar/typescript': 1.3.0-alpha.0 '@volar/typescript': 1.3.0-alpha.0
'@volar/vue-language-core': 1.2.0 '@volar/vue-language-core': 1.2.0
'@vscode/markdown-it-katex@1.0.3':
dependencies:
katex: 0.16.4
'@vue/compiler-core@3.2.47': '@vue/compiler-core@3.2.47':
dependencies: dependencies:
'@babel/parser': 7.21.2 '@babel/parser': 7.21.2

View File

@ -1,7 +1,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { computed, onMounted, onUnmounted, onUpdated, ref } from 'vue' import { computed, onMounted, onUnmounted, onUpdated, ref } from 'vue'
import MarkdownIt from 'markdown-it' import MarkdownIt from 'markdown-it'
import mdKatex from '@traptitech/markdown-it-katex' import mdKatex from '@vscode/markdown-it-katex'
import mila from 'markdown-it-link-attributes' import mila from 'markdown-it-link-attributes'
import hljs from 'highlight.js' import hljs from 'highlight.js'
import { useBasicLayout } from '@/hooks/useBasicLayout' import { useBasicLayout } from '@/hooks/useBasicLayout'
@ -36,7 +36,7 @@ const mdi = new MarkdownIt({
}) })
mdi.use(mila, { attrs: { target: '_blank', rel: 'noopener' } }) mdi.use(mila, { attrs: { target: '_blank', rel: 'noopener' } })
mdi.use(mdKatex, { blockClass: 'katexmath-block rounded-md p-[10px]', errorColor: ' #cc0000' }) mdi.use(mdKatex)
const wrapClass = computed(() => { const wrapClass = computed(() => {
return [ return [