mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-09-19 01:36:38 +08:00
feat: LaTeX parse is ready
This commit is contained in:
parent
60df732db7
commit
dc2b768c6b
11
web/package-lock.json
generated
11
web/package-lock.json
generated
@ -19,7 +19,6 @@
|
|||||||
"json-bigint": "^1.0.0",
|
"json-bigint": "^1.0.0",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"markdown-it": "^13.0.1",
|
"markdown-it": "^13.0.1",
|
||||||
"markdown-it-emoji": "^3.0.0",
|
|
||||||
"md-editor-v3": "^2.2.1",
|
"md-editor-v3": "^2.2.1",
|
||||||
"pinia": "^2.1.4",
|
"pinia": "^2.1.4",
|
||||||
"qrcode": "^1.5.3",
|
"qrcode": "^1.5.3",
|
||||||
@ -7431,11 +7430,6 @@
|
|||||||
"markdown-it": "bin/markdown-it.js"
|
"markdown-it": "bin/markdown-it.js"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/markdown-it-emoji": {
|
|
||||||
"version": "3.0.0",
|
|
||||||
"resolved": "https://registry.npmmirror.com/markdown-it-emoji/-/markdown-it-emoji-3.0.0.tgz",
|
|
||||||
"integrity": "sha512-+rUD93bXHubA4arpEZO3q80so0qgoFJEKRkRbjKX8RTdca89v2kfyF+xR3i2sQTwql9tpPZPOQN5B+PunspXRg=="
|
|
||||||
},
|
|
||||||
"node_modules/markdown-it/node_modules/argparse": {
|
"node_modules/markdown-it/node_modules/argparse": {
|
||||||
"version": "2.0.1",
|
"version": "2.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
|
||||||
@ -17367,11 +17361,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"markdown-it-emoji": {
|
|
||||||
"version": "3.0.0",
|
|
||||||
"resolved": "https://registry.npmmirror.com/markdown-it-emoji/-/markdown-it-emoji-3.0.0.tgz",
|
|
||||||
"integrity": "sha512-+rUD93bXHubA4arpEZO3q80so0qgoFJEKRkRbjKX8RTdca89v2kfyF+xR3i2sQTwql9tpPZPOQN5B+PunspXRg=="
|
|
||||||
},
|
|
||||||
"md-editor-v3": {
|
"md-editor-v3": {
|
||||||
"version": "2.11.3",
|
"version": "2.11.3",
|
||||||
"resolved": "https://registry.npmjs.org/md-editor-v3/-/md-editor-v3-2.11.3.tgz",
|
"resolved": "https://registry.npmjs.org/md-editor-v3/-/md-editor-v3-2.11.3.tgz",
|
||||||
|
@ -19,6 +19,8 @@
|
|||||||
"json-bigint": "^1.0.0",
|
"json-bigint": "^1.0.0",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"markdown-it": "^13.0.1",
|
"markdown-it": "^13.0.1",
|
||||||
|
"markdown-it-latex2img": "^0.0.6",
|
||||||
|
"markdown-it-mathjax": "^2.0.0",
|
||||||
"md-editor-v3": "^2.2.1",
|
"md-editor-v3": "^2.2.1",
|
||||||
"pinia": "^2.1.4",
|
"pinia": "^2.1.4",
|
||||||
"qrcode": "^1.5.3",
|
"qrcode": "^1.5.3",
|
||||||
|
@ -509,6 +509,8 @@ const removeChat = function (event, chat) {
|
|||||||
curOpt.value = 'remove';
|
curOpt.value = 'remove';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const latexPlugin = require('markdown-it-latex2img')
|
||||||
|
const mathjaxPlugin = require('markdown-it-mathjax')
|
||||||
const md = require('markdown-it')({
|
const md = require('markdown-it')({
|
||||||
breaks: true,
|
breaks: true,
|
||||||
html: true,
|
html: true,
|
||||||
@ -533,6 +535,8 @@ const md = require('markdown-it')({
|
|||||||
return `<pre class="code-container"><code class="language-${lang} hljs">${preCode}</code>${copyBtn}</pre>`
|
return `<pre class="code-container"><code class="language-${lang} hljs">${preCode}</code>${copyBtn}</pre>`
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
md.use(latexPlugin)
|
||||||
|
md.use(mathjaxPlugin)
|
||||||
|
|
||||||
// 创建 socket 连接
|
// 创建 socket 连接
|
||||||
const prompt = ref('');
|
const prompt = ref('');
|
||||||
|
@ -141,6 +141,8 @@ checkSession().then(user => {
|
|||||||
router.push('/login')
|
router.push('/login')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const latexPlugin = require('markdown-it-latex2img')
|
||||||
|
const mathjaxPlugin = require('markdown-it-mathjax')
|
||||||
const md = require('markdown-it')({
|
const md = require('markdown-it')({
|
||||||
breaks: true,
|
breaks: true,
|
||||||
html: true,
|
html: true,
|
||||||
@ -165,6 +167,9 @@ const md = require('markdown-it')({
|
|||||||
return `<pre class="code-container"><code class="language-${lang} hljs">${preCode}</code>${copyBtn}</pre>`
|
return `<pre class="code-container"><code class="language-${lang} hljs">${preCode}</code>${copyBtn}</pre>`
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
md.use(latexPlugin)
|
||||||
|
md.use(mathjaxPlugin)
|
||||||
|
|
||||||
|
|
||||||
const onLoad = () => {
|
const onLoad = () => {
|
||||||
httpGet('/api/chat/history?chat_id=' + chatId).then(res => {
|
httpGet('/api/chat/history?chat_id=' + chatId).then(res => {
|
||||||
|
Loading…
Reference in New Issue
Block a user