feat(markdown): 只读内容支持 Markdown 渲染

- 新增 MarkdownRenderer.vue 组件,基于 marked 解析 GFM
- 学习残片/报告历史列表:纯文本 {{ }} 替换为 MarkdownRenderer
- ReviewDetail.vue content-body:p 标签逐行渲染替换为 MarkdownRenderer
- 结束会话总结框:增加「编辑/预览」切换,预览模式实时渲染 markdown
- 学习预期展示也改为 MarkdownRenderer
This commit is contained in:
2026-07-05 12:24:26 +08:00
parent c41aa09b4a
commit 62e12686e3
5 changed files with 211 additions and 14 deletions
+2 -3
View File
@@ -13,6 +13,7 @@ import {
import { getSessionDetail } from "@/api/studySessions";
import { updateFragments } from "@/api/reportFragments";
import { ElMessage } from "element-plus";
import MarkdownRenderer from "@/components/MarkdownRenderer.vue";
const route = useRoute();
const router = useRouter();
@@ -301,9 +302,7 @@ watch(
<!-- 只读模式 -->
<template v-else>
<div class="content-body" v-if="content">
<p v-for="(line, idx) in content.split('\n')" :key="idx">
{{ line || " " }}
</p>
<MarkdownRenderer :content="content" />
</div>
<div v-else class="empty-content">暂无内容</div>
</template>