mirror of https://github.com/langgenius/dify.git
fix: fix markdown escape issue
This commit is contained in:
parent
8611301722
commit
f98d2aaffb
|
|
@ -18,12 +18,19 @@ const BasicContent: FC<BasicContentProps> = ({
|
|||
if (annotation?.logAnnotation)
|
||||
return <Markdown content={annotation?.logAnnotation.content || ''} />
|
||||
|
||||
// Preserve Windows UNC paths and similar backslash-heavy strings by
|
||||
// wrapping them in inline code so Markdown renders backslashes verbatim.
|
||||
let displayContent = content
|
||||
if (typeof content === 'string' && /^\\\\\S.*/.test(content) && !/^`.*`$/.test(content)) {
|
||||
displayContent = `\`${content}\``
|
||||
}
|
||||
|
||||
return (
|
||||
<Markdown
|
||||
className={cn(
|
||||
item.isError && '!text-[#F04438]',
|
||||
)}
|
||||
content={content}
|
||||
content={displayContent}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue