Skip to content

Commit

Permalink
try adding icon after link
Browse files Browse the repository at this point in the history
  • Loading branch information
beyackle committed Nov 15, 2023
1 parent 7514e26 commit 01e4c9b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/app/ui/CitationWindowProvider/private/CitationWindow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,14 @@ const CitationWindow = ({ text, title, onClose: handleClose }: Props) => {

function annotateLink(link: HTMLAnchorElement) {
console.log(link);
link.ariaLabel = link.ariaLabel ?? externalLinkAlt;

const icon = document.createElement('img');
icon.className = 'webchat__render-markdown__external-link-icon';
icon.ariaLabel = link.ariaLabel ?? externalLinkAlt;
link.rel = 'noopener noreferrer';
link.target = '_blank';
// other link manipulation here

link.appendChild(icon);
}

const contents = parseIntoHTML(text);
Expand Down

0 comments on commit 01e4c9b

Please sign in to comment.