Skip to content

Commit f0ceed1

Browse files
committed
fix: 修正输出里出现$$ 导致解析错乱的问题
1 parent 5538a08 commit f0ceed1

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/resources/chatPanelScript.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,11 @@ async function renderMessage(role, content, index) {
165165
if (role === 'model') {
166166
let markdownContent = targetDiv.dataset.markdownContent;
167167

168-
//if (markdownContent.includes('<think>') && !markdownContent.includes('</think>')){
169-
// markdownContent += "</think>";
170-
//}
168+
if (markdownContent.includes('<think>') && !markdownContent.includes('</think>')){
169+
markdownContent += "</think>";
170+
}
171+
172+
markdownContent = markdownContent.replace(/\$\$/g, '\\$ \\$ 包裹');
171173

172174
targetDiv.innerHTML = marked.parse(markdownContent, {
173175
breaks: false,

0 commit comments

Comments
 (0)