Skip to content

Commit

Permalink
Merge pull request #2764 from owid/fix-url-parser
Browse files Browse the repository at this point in the history
fix(url-parser): allow ':' in urls
  • Loading branch information
sophiamersmann authored Oct 13, 2023
2 parents 8718595 + af7f04c commit 19cdbb9
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ const plainUrlParser = (): P.Parser<PlainUrl> =>

// 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<NonBracketWord> = () =>
P.regex(/[^\[\]\s]+/).map((val) => ({ type: "text", value: val })) // no brackets, no WS
Expand Down

0 comments on commit 19cdbb9

Please sign in to comment.