Skip to content

Commit

Permalink
Merge pull request ChatGPTNextWeb#5827 from ConnectAI-E/fix/markdown-…
Browse files Browse the repository at this point in the history
…embed-codeblock

fix: 代码块嵌入小代码块时渲染错误
  • Loading branch information
lloydzhou authored Nov 15, 2024
2 parents b08ce56 + e562165 commit f22cec1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/components/markdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit f22cec1

Please sign in to comment.