Skip to content

Commit

Permalink
UI - Merge missed code added
Browse files Browse the repository at this point in the history
  • Loading branch information
Bangarraju-Microsoft committed Jan 8, 2025
1 parent d973164 commit 9849512
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion frontend/src/pages/chat/Components/CitationPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ interface CitationPanelProps {
}

export const CitationPanel: React.FC<CitationPanelProps> = ({ activeCitation, IsCitationPanelOpen, onViewSource }) => {

const renderLink = (props: any) => {
return <a {...props} target="_blank" rel="noopener noreferrer" />;
};

return (
<Stack.Item className={styles.citationPanel} tabIndex={0} role="tabpanel" aria-label="Citations Panel">
<Stack
Expand Down Expand Up @@ -45,11 +50,13 @@ export const CitationPanel: React.FC<CitationPanelProps> = ({ activeCitation, Is
</h5>
<div tabIndex={0}>
<ReactMarkdown
linkTarget="_blank"
className={styles.citationPanelContent}
children={DOMPurify.sanitize(activeCitation.content, { ALLOWED_TAGS: XSSAllowTags })}
remarkPlugins={[remarkGfm]}
rehypePlugins={[rehypeRaw]}
components={{
a: renderLink,
}}
/>
</div>
</Stack.Item>
Expand Down

0 comments on commit 9849512

Please sign in to comment.