sendbird / chat-ai-widget

Build AI Chatbot in minutes with Sendbird Chatbot Widget.
https://sendbird.github.io/chat-ai-widget/
MIT License
28 stars 17 forks source link

Hyperlinks to phone numbers using Markdown syntax in chatbot messages do not open correctly when clicked #333

Closed mobiware closed 2 months ago

mobiware commented 3 months ago

If we include a hyperlink to a phone number using Markdown syntax in one of the messages returned by the chatbot, the link does not open correctly when clicked (on a mobile phone of course).

For instance, let's say we include the following Markdown syntax in our message:

Please call [(555) 123-4567](tel:+15551234567)

This is turned into a hyperlink when displayed in the chat bot, but the hyperlink doesn't start a phone call when clicked on mobile because the href is replaced with #:

<a class="sendbird-word__url" href="#" target="_blank" rel="noreferrer">(555) 123-4567</a>

so when we click the link, it just opens the same page in another tab

We would expect phone links to be rendered as:

<a class="sendbird-word__url" href="+15551234567" target="_blank" rel="noreferrer">(555) 123-4567</a>

which will initiate a phone call when clicked on a mobile device