Skip to content

Commit

Permalink
remove adding a trailing slash
Browse files Browse the repository at this point in the history
  • Loading branch information
Puyodead1 committed Sep 3, 2023
1 parent c764bab commit c1c0ce9
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/components/messaging/Message.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,9 @@ const Linkify = ({ children }: { children: string }) => {
const matchIndex = children.indexOf(match, lastIndex);
if (matchIndex > lastIndex) elements.push(children.substring(lastIndex, matchIndex));

// add a trailing slash if there isn't one
const formattedLink = match.endsWith("/") ? match : `${match}/`;

elements.push(
<Link key={matchIndex} href={formattedLink} target="_blank" rel="noreferrer">
{formattedLink}
<Link key={matchIndex} href={match} target="_blank" rel="noreferrer">
{match}
</Link>,
);
lastIndex = matchIndex + match.length;
Expand Down

0 comments on commit c1c0ce9

Please sign in to comment.