完整科学研究web
This commit is contained in:
@@ -178,12 +178,10 @@ const renderMarkdown = (content: string) => {
|
||||
.replace(/\\n/g, '\n') // 将字面量"\n"转为实际换行符
|
||||
.replace(/\n{3,}/g, '\n\n'); // 将三个及以上连续换行符规范为两个,确保段落分隔
|
||||
|
||||
// 配置marked渲染选项
|
||||
// 仅保留marked通用且无类型冲突的基础配置(避免版本差异导致的报错)
|
||||
marked.setOptions({
|
||||
breaks: true, // 单换行符渲染为<br>
|
||||
gfm: true, // 支持GitHub Flavored Markdown
|
||||
tables: true, // 支持表格
|
||||
headerIds: false // 不生成header的id属性
|
||||
gfm: true // 支持GitHub Flavored Markdown(包含表格、列表等核心功能)
|
||||
});
|
||||
|
||||
// 调试:输出预处理后的内容
|
||||
|
||||
Reference in New Issue
Block a user