Hi Everybody is there any extention that when someone share telephone number will make it clickable like
012 345 6789 turn tel:+0123456789
thanks for all anvers in the beginning....
Telephone Link Extention
I don't think anyone has implemented such a feature yet.
But it's definitely doable using the TextFormatter API. Flarum ships with the built-in "AutoLink" plugin https://s9etextformatter.readthedocs.io/Plugins/Autolink/Synopsis/ so it isn't difficult to imagine someone implementing an "AutoTel" plugin.
If you're looking at implementing this yourself, you could take a look at the source code of AutoLink. I assume it's a regex-based TextFormatter tag. I'm not sure if we have any example of an extension that implements regex-based TextFormatter tags apart from the Mentions extension but that extension is probably not a good example as there's a lot of additional logic specific to mentions.
- Edited
I think a bbcode could do it, but i just dont know how the code would look like, long ages ago we used to know all bbcodes, script was wml
+0123456789
[link] +0123456789 [/link]
<href= "tel: 000000000>00000000000</a>
ugr but it should work on hard html page
I think can be simple with a regex
- Edited
Justoverclock one way as I’m sure you already thought about, is adding this to hashtags. No need for a separate new extension. Just pick a character that should be used in front of the number, and duplicate/slightly modify the hashtag RegEx.
So maybe, to auto link a phone number you must first type +? That way the RegEx can look for any number preceded by +.
The only downside, just like a BBcode, your users have to know and remember to do it like this.
010101 also purify extension have a custom regex that admin can choose into extension settings