From 8c9da833bf0c5cf9644c0df62d7150a8358ca5f6 Mon Sep 17 00:00:00 2001 From: James Grugett Date: Sun, 10 Apr 2022 19:47:26 -0500 Subject: [PATCH] Don't match parenthses in link url --- web/components/linkify.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/components/linkify.tsx b/web/components/linkify.tsx index 21567b59..459fdf0c 100644 --- a/web/components/linkify.tsx +++ b/web/components/linkify.tsx @@ -6,7 +6,7 @@ import { SiteLink } from './site-link' export function Linkify(props: { text: string; gray?: boolean }) { const { text, gray } = props const regex = - /(?:^|\s)(?:[@#][a-z0-9_]+|https?:\/\/[-A-Za-z0-9+&@#\/%?=~_()|!:,.;]*[-A-Za-z0-9+&@#\/%=~_()|])/gi + /(?:^|\s)(?:[@#][a-z0-9_]+|https?:\/\/[-A-Za-z0-9+&@#\/%?=~_()|!:,.;]*[-A-Za-z0-9+&@#\/%=~_|])/gi const matches = text.match(regex) || [] const links = matches.map((match) => { // Matches are in the form: " @username" or "https://example.com"