mirror of
https://github.com/Chanzhaoyu/chatgpt-web.git
synced 2025-07-22 20:51:39 +00:00
feat: 支持 markdown 格式 (#77)
* feat: 支持 markdown 格式和图片 * perf: 重载的时候滚动条保持 * chore: version 2.5.2 * feat: 添加文字换行 * chore: 添加新封面 * chore: 更新 cover
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import type { App, Directive } from 'vue'
|
||||
import hljs from 'highlight.js'
|
||||
import includeCode from '@/utils/functions/includeCode'
|
||||
|
||||
function highlightCode(el: HTMLElement) {
|
||||
const regexp = /^(?:\s{4}|\t).+/gm
|
||||
if (el.textContent?.indexOf(' = ') !== -1 || el.textContent.match(regexp))
|
||||
if (includeCode(el.textContent))
|
||||
hljs.highlightBlock(el)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user