TalkJS supports limited markup syntax similar to popular chat tools such as WhatsApp and Slack:
Only code can contain newlines; all other markup is only applied when the marked-up text contains no newlines.
Markup is only applied if the begin/end-characters come at the beginning or the end of a word. For example:
_this becomes italic_
this_ doesn't _change.
Multiple kinds of markup can be combined
You can make clickable text with simple
<..|..> formatting. All URLs must be absolute.
To read more, <https://example.com|click here>
- To read more, click here
Write something here, or <mailto:[email protected]|email us directly>
- Write something here, or email us directly
Note: This syntax is intended as a simple way to make programmatically generated messages a bit more interactive. Thefore, it only works with messages sent via the REST API and not with messages sent from the chat UI.
Unformatted URLs are also made clickable in all messages, just like they are in emails:
More info on https://example.com
- More info on https://example.com
Note: this only works if the "Suppress Contact Information" role setting is disabled or configured such that the specified URL is not masked.
Like in user messages, all unicode emojis are supported. Just put the unicode emoji character in the message string and TalkJS will make them work appropriately cross-platform.