Merge pull request #204 from llovvoll/fix/email

add: email address format verification
This commit is contained in:
Timothy 2021-08-27 00:23:04 +08:00 committed by GitHub
commit b6dabfb653
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -17,7 +17,8 @@ const components = {
}
const SocialIcon = ({ kind, href, size = 8 }) => {
if (!href) return null
if (!href || (kind === 'mail' && !/^mailto:\w+([.-]?\w+)@\w+([.-]?\w+)(.\w{2,3})+$/.test(href)))
return null
const SocialSvg = components[kind]