diff --git a/client/src/javascript/components/general/LinkedText.tsx b/client/src/javascript/components/general/LinkedText.tsx index a49ccdb3a..b0f4b1458 100644 --- a/client/src/javascript/components/general/LinkedText.tsx +++ b/client/src/javascript/components/general/LinkedText.tsx @@ -18,15 +18,19 @@ function isValidHttpUrl(s: string) { } const LinkedText: FC = ({text, className}: LinkedTextProps) => { - const nodes = text.split(/\s/).map((s) => - isValidHttpUrl(s.trimEnd()) ? ( - - {s} - - ) : ( - s - ), - ); + const nodes = text.split(/([ \n])/).map((s) => { + if (s === '\n') { + return
; + } + if (isValidHttpUrl(s)) { + return ( + + {s} + + ); + } + return s; + }); return {nodes}; };