diff --git a/packages/@ourworldindata/utils/src/MarkdownTextWrap/parser.ts b/packages/@ourworldindata/utils/src/MarkdownTextWrap/parser.ts index d1d5cdd1cac..9ea79b74636 100644 --- a/packages/@ourworldindata/utils/src/MarkdownTextWrap/parser.ts +++ b/packages/@ourworldindata/utils/src/MarkdownTextWrap/parser.ts @@ -249,7 +249,7 @@ const plainUrlParser = (): P.Parser => // https://urlregex.com const urlRegex = - /((([A-Za-z]{3,9}:(?:\/\/)?)(?:[\-;:&=\+\$,\w]+@)?[A-Za-z0-9\.\-]+|(?:www\.|[\-;:&=\+\$,\w]+@)[A-Za-z0-9\.\-]+)((?:\/[\+~%\/\.\w\-_]*)?\??(?:[\-\+=&;%@~\.\w_]*)#?(?:[\.\!\/\\\w\-]*))?)/ + /((([A-Za-z]{3,9}:(?:\/\/)?)(?:[\-;:&=\+\$,\w]+@)?[A-Za-z0-9\.\-]+|(?:www\.|[\-;:&=\+\$,\w]+@)[A-Za-z0-9\.\-]+)((?:\/[\+~:%\/\.\w\-_]*)?\??(?:[\-\+=&;%@~:\.\w_]*)#?(?:[\.\!\/\\\w\-]*))?)/ const nonBracketWordParser: (r: MdParser) => P.Parser = () => P.regex(/[^\[\]\s]+/).map((val) => ({ type: "text", value: val })) // no brackets, no WS