This commit is contained in:
Team3
2026-06-06 21:31:03 +02:00
parent 20f42974a5
commit 08e67cb4f1
10 changed files with 111 additions and 178 deletions

View File

@@ -1,9 +1,21 @@
<script setup>
import { computed, ref, watch, nextTick, onMounted, onUnmounted } from 'vue'
import { marked } from 'marked'
import { markedHighlight } from 'marked-highlight'
import hljs from 'highlight.js'
import 'highlight.js/styles/github-dark.css'
import DOMPurify from 'dompurify'
import { fetchGuideContent, chatGuide, fetchProgress, setProgress } from '../api.js'
marked.use(markedHighlight({
langPrefix: 'hljs language-',
highlight(code, lang) {
if (lang && hljs.getLanguage(lang)) {
return hljs.highlight(code, { language: lang }).value
}
return hljs.highlightAuto(code).value
},
}))
marked.setOptions({ breaks: true, gfm: true })
function renderMarkdown(text) {