mirror of
https://github.com/pacnpal/Roo-Code.git
synced 2025-12-20 04:11:10 -05:00
Fix markdown preprocessing
This commit is contained in:
@@ -800,25 +800,9 @@ const ProgressIndicator = () => (
|
||||
)
|
||||
|
||||
const Markdown = memo(({ markdown }: { markdown?: string }) => {
|
||||
const withoutThinkingTags = useMemo(() => {
|
||||
if (!markdown) return ""
|
||||
|
||||
let processed = markdown
|
||||
|
||||
// Remove end substrings of <thinking or </thinking
|
||||
processed = processed.replace(/<\/?t(?:h(?:i(?:n(?:k(?:i(?:n(?:g)?)?)?)?)?)?)?$/, "")
|
||||
|
||||
// Remove all instances of <thinking> (with optional line break after) and </thinking> (with optional line break before)
|
||||
// Needs to be separate since we dont want to remove the line break before the first tag
|
||||
processed = processed.replace(/<thinking>\s?/g, "")
|
||||
processed = processed.replace(/\s?<\/thinking>/g, "")
|
||||
|
||||
return processed
|
||||
}, [markdown])
|
||||
|
||||
return (
|
||||
<div style={{ wordBreak: "break-word", overflowWrap: "anywhere", marginBottom: -15, marginTop: -15 }}>
|
||||
<MarkdownBlock markdown={withoutThinkingTags} />
|
||||
<MarkdownBlock markdown={markdown} />
|
||||
</div>
|
||||
)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user