Skip to content
This repository has been archived by the owner on Jan 23, 2025. It is now read-only.

fix(link): allow all non-whitespace chars in urls #757

Merged
merged 2 commits into from
Dec 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/utils/item.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,9 @@ export const isUrlValid = (str?: string | null): boolean => {
'((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|' + // domain name
'((\\d{1,3}\\.){3}\\d{1,3})|' + // OR ip (v4) address
'localhost)' + // OR localhost alias
'(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*' + // port and path
'(\\?[;&a-z\\d%_.~+=-]*)?' + // query string
'(\\:\\d+)?' + // post (optional)
'(\\/\\S*?)*' + // path (lazy: takes as few as possible)
'(\\?\\S*?)?' + // query string (lazy)
'(\\#\\S*)?$', // fragment locator
'i',
);
Expand Down