Skip to content

Commit f22cec1

Browse files
authored
Merge pull request ChatGPTNextWeb#5827 from ConnectAI-E/fix/markdown-embed-codeblock
fix: 代码块嵌入小代码块时渲染错误
2 parents b08ce56 + e562165 commit f22cec1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

app/components/markdown.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,10 @@ function escapeBrackets(text: string) {
248248

249249
function tryWrapHtmlCode(text: string) {
250250
// try add wrap html code (fixed: html codeblock include 2 newline)
251+
// ignore embed codeblock
252+
if (text.includes("```")) {
253+
return text;
254+
}
251255
return text
252256
.replace(
253257
/([`]*?)(\w*?)([\n\r]*?)(<!DOCTYPE html>)/g,

0 commit comments

Comments
 (0)