catamphetamine / libphonenumber-js

A simpler (and smaller) rewrite of Google Android's libphonenumber library in javascript
https://catamphetamine.gitlab.io/libphonenumber-js/
MIT License
2.76k stars 218 forks source link

Find and replace in text problem #460

Open onigetoc opened 5 months ago

onigetoc commented 5 months ago

I want to find and replace in a text by a tel:1234567890 link, but the findPhoneNumbersInText object shows me the formatted version and not the original. If there will have a kind of numberOriginal in the object it would be easy to replace with a link in the text for mobile phone but in the text it is not always formatted.

I know there's a React demo who do it here: https://catamphetamine.gitlab.io/libphonenumber-js/ but i want to use it in plain JavaScript or with angular and do not know how to convert from React to angular or simple JavaScript or TS.