mirror of
https://github.com/simstudioai/sim.git
synced 2026-04-06 03:00:16 -04:00
some fixes
This commit is contained in:
@@ -61,6 +61,19 @@ function ModalCopilotMessage({ message }: CopilotModalMessage) {
|
||||
return match
|
||||
})
|
||||
|
||||
// Also replace standalone ↗ symbols with clickable citation links
|
||||
if (citations && citations.length > 0) {
|
||||
let citationIndex = 0
|
||||
processedText = processedText.replace(/↗/g, () => {
|
||||
if (citationIndex < citations.length) {
|
||||
const citation = citations[citationIndex]
|
||||
citationIndex++
|
||||
return `<a href="${citation.url}" target="_blank" rel="noopener noreferrer" class="inline-flex items-center text-primary hover:text-primary/80 text-sm" title="${citation.title}">↗</a>`
|
||||
}
|
||||
return '↗'
|
||||
})
|
||||
}
|
||||
|
||||
return processedText
|
||||
}
|
||||
|
||||
|
||||
@@ -342,6 +342,20 @@ export const Copilot = forwardRef<CopilotRef, CopilotProps>(
|
||||
return match
|
||||
})
|
||||
|
||||
// Also replace standalone ↗ symbols with clickable citation links
|
||||
// This handles cases where the LLM outputs ↗ directly
|
||||
if (citations && citations.length > 0) {
|
||||
let citationIndex = 0
|
||||
processedContent = processedContent.replace(/↗/g, () => {
|
||||
if (citationIndex < citations.length) {
|
||||
const citation = citations[citationIndex]
|
||||
citationIndex++
|
||||
return `<a href="${citation.url}" target="_blank" rel="noopener noreferrer" class="inline-flex items-center text-primary hover:text-primary/80 transition-colors text-sm" title="${citation.title}">↗</a>`
|
||||
}
|
||||
return '↗'
|
||||
})
|
||||
}
|
||||
|
||||
// Basic markdown processing for better formatting
|
||||
processedContent = processedContent
|
||||
// Handle code blocks
|
||||
|
||||
Reference in New Issue
Block a user