Overview
CometChatUrlsFormatter
is a specialized subclass of CometChatTextFormatter
designed to automatically detect URLs in text messages and convert them into clickable links, allowing users to navigate to the web addresses effortlessly within your CometChat application.

Usage
CometChatUrlsFormatter
utilizes regular expressions to identify URLs and applies styles to make them visually distinct as clickable links. Here’s an example of how to extend the CometChatTextFormatter
to create a URL text formatter:
Customize
When implementing the CometChatUrlsFormatter, you can customize the appearance of links and the behavior when clicked:- Modify the onRegexMatch method to wrap detected URLs in a span element with custom classes for styling.
- In registerEventListeners, define the onUrlClick method to handle opening URLs, tracking analytics, or other custom behavior upon click.