Don't match parenthses in link url
This commit is contained in:
parent
4a9fc7bc9b
commit
8c9da833bf
|
@ -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"
|
||||
|
|
Loading…
Reference in New Issue
Block a user