Skip to content

Commit 702bd12

Browse files
authored
Merge pull request #37 from cmdrGuyson/fix-link-validation
Fix for the link validation to consider single character domains
2 parents ffb9bdb + 5bcd657 commit 702bd12

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/components/LinkPreview.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const isValidUrlProp = (props, propName, componentName) => {
1515

1616
const isValidUrl = (url) => {
1717
const regex =
18-
/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_+.~#?&//=]*)/
18+
/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_+.~#?&//=]*)/
1919
const validUrl = regex.test(url)
2020
return validUrl
2121
}

0 commit comments

Comments
 (0)