Skip to content

Commit

Permalink
Merge pull request #209 from MetaCell/feature/SDSV-9
Browse files Browse the repository at this point in the history
#sdsv-9 Ensure all urls on Metadata panel are displayed as link
  • Loading branch information
jrmartin authored Jan 31, 2024
2 parents a1acd4f + e94ebb5 commit 197cde5
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/components/NodeDetailView/Details/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,5 @@ export const simpleValue = (label, value) => {
}

export const isValidUrl = (urlString) => {
var urlPattern = new RegExp('^(https?:\\/\\/)?' + // validate protocol
'((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|' + // validate domain name
'((\\d{1,3}\\.){3}\\d{1,3}))' + // validate OR ip (v4) address
'(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*' + // validate port and path
'(\\?[;&a-z\\d%_.~+=-]*)?' + // validate query string
'(\\#[-a-z\\d_]*)?$', 'i'); // validate fragment locator
return !!urlPattern.test(urlString);
return /(https:\/\/www\.|http:\/\/www\.|https:\/\/|http:\/\/)?[a-zA-Z]{2,}(\.[a-zA-Z]{2,})(\.[a-zA-Z]{2,})?\/[a-zA-Z0-9]{2,}|((https:\/\/www\.|http:\/\/www\.|https:\/\/|http:\/\/)?[a-zA-Z]{2,}(\.[a-zA-Z]{2,})(\.[a-zA-Z]{2,})?)|(https:\/\/www\.|http:\/\/www\.|https:\/\/|http:\/\/)?[a-zA-Z0-9]{2,}\.[a-zA-Z0-9]{2,}\.[a-zA-Z0-9]{2,}(\.[a-zA-Z0-9]{2,})?/g.test(urlString);
}

0 comments on commit 197cde5

Please sign in to comment.