Skip to main content

Markdown

Markdown is a simple text formatting language that is used in LoyJoy to format text messages. LoyJoy supports a subset of Markdown, which is described in this guide.

Markdown in general is a very simple language that is easy to learn. You can find a good introduction to Markdown here.

Text Formatting

In LoyJoy you can format text messages with the following Markdown format:

This is some **bold** text.

In LoyJoy you can add links to most text messages with the following Markdown format:

This is some link [link text](https://www.example.org) to example.org.

For the web chat, such Markdown links will be transformed to normal HTML links, i.e. HTML anchor tags.

This in turn is useful e.g. when using clickable telephone numbers. This example shows how to turn a phone number into clickable in the chat. When clicked, a mobile device will offer to call the number.

[+0123 12345](tel:+012312345)

In case of other channels such as Facebook and WhatsApp the link automatically will be formatted as needed by the channel.

Most web browsers will open a new tab, when the customer clicks on a link generated with the format [link text](https://www.example.org). Thus, this format is best for sending the customer out of the chat to a separate web browser tab, e.g. for jumping to a separate webpage with terms and conditions.

However, if you want to trigger some JavaScript written by you on a webpage hosting the LoyJoy web chat, you can use the following format:

This is some link [link text](https://www.example.org)(@test) that triggers an event named test.

You can choose any event name you like, test is just an example. Links formatted this way will trigger an event listener as described in the How to Integrate Tracking, which then can call arbitrary JavaScript code written by you.

caution

Links with an added event will not open the target URL. In such cases your event handler code should include e.g. opening a popup or starting a redirect.