소스 검색

Merge pull request #5827 from ConnectAI-E/fix/markdown-embed-codeblock

fix: 代码块嵌入小代码块时渲染错误
Lloyd Zhou 1 년 전
부모
커밋
f22cec1eb4
1개의 변경된 파일4개의 추가작업 그리고 0개의 파일을 삭제
  1. 4 0
      app/components/markdown.tsx

+ 4 - 0
app/components/markdown.tsx

@@ -248,6 +248,10 @@ function escapeBrackets(text: string) {
 
 function tryWrapHtmlCode(text: string) {
   // try add wrap html code (fixed: html codeblock include 2 newline)
+  // ignore embed codeblock
+  if (text.includes("```")) {
+    return text;
+  }
   return text
     .replace(
       /([`]*?)(\w*?)([\n\r]*?)(<!DOCTYPE html>)/g,