Merge pull request #204 from llovvoll/fix/email
add: email address format verification
This commit is contained in:
commit
b6dabfb653
|
@ -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]
|
||||
|
||||
|
|
Loading…
Reference in a new issue