diff --git a/api-editor/gui/src/features/packageData/selectionView/DocumentationText.tsx b/api-editor/gui/src/features/packageData/selectionView/DocumentationText.tsx index 2be994d56..f851697ab 100644 --- a/api-editor/gui/src/features/packageData/selectionView/DocumentationText.tsx +++ b/api-editor/gui/src/features/packageData/selectionView/DocumentationText.tsx @@ -2,6 +2,7 @@ import { Code, Flex, HStack, + Icon, IconButton, Link as ChakraLink, Stack, @@ -10,7 +11,7 @@ import { } from '@chakra-ui/react'; import 'katex/dist/katex.min.css'; import React, { ClassAttributes, FunctionComponent, HTMLAttributes, useState } from 'react'; -import { FaChevronDown, FaChevronRight } from 'react-icons/fa'; +import { FaChevronDown, FaChevronRight, FaExternalLinkAlt } from 'react-icons/fa'; import ReactMarkdown from 'react-markdown'; import { CodeComponent, @@ -40,11 +41,20 @@ type ParagraphComponent = FunctionComponent< type LinkComponent = ComponentType & ReactMarkdownProps>; const CustomLink: LinkComponent = function ({ className, children, href }) { - return ( - - {children} - - ); + const to = href ?? '#'; + if (to.startsWith('http')) { + return ( + + {children} + + ); + } else { + return ( + + {children} + + ); + } }; const CustomCode: CodeComponent = function ({ className, children }) {