Skip to content

Commit

Permalink
fix: phone regex
Browse files Browse the repository at this point in the history
  • Loading branch information
mamico committed Nov 23, 2024
1 parent 86ffb97 commit 5063713
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/components/ItaliaTheme/View/Commons/ContactLink.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ const ContactLink = ({ tel, fax, email, label = true, strong = false }) => {

const formatTel = (str, type) =>
str
.split(
/((?:\+?\d{1,3}[-.\s]?)?(?:\(?\d{3}\)?[-.\s]?)?\d{3}[-.\s]?\d{4})/gm,
)
.split(/((?:\+?\d{1,3}[-.\s]?)?(?:\(?\d{3}\)?[-.\s]?)?\d{3}[-.\s]?\d+)/gm)
.map((v, i) =>
i % 2 === 0 ? (
<span key={i}>{` ${v} `}</span>
Expand Down

0 comments on commit 5063713

Please sign in to comment.