Text formatting and semantics

Tags

MessageML supports the following tags for formatting content within a message:

Tag

Description

Optional attributes

<br/>

Insert a line break.

None.

<a href="url"> Link Text </a>

Insert a hyperlink that will be displayed in the message.

href: the URL of the link class: color options.

<b>text</b>

Bold formatting. Note: when receiving a message from an Agent that contains whitespace between the last character in a bolded section and the closing </b> tag, the bold section will be returned in Markdown (i.e. surrounded by double '*' characters) instead of XHTML tags.

class: color options.

<i>text</i>

Italics formatting. Note: when receiving a message from an Agent that contains whitespace between the last character in an italics-formatted section and the closing </i> tag, the italics section will be returned in Markdown (i.e. surrounded by single '*' characters) instead of XHTML tags.

class: color options.

<pre> preformatted text </pre>

Preformatted text.

class: color options. • Non-HTML MessageML shorthand tags are not supported inside <pre>.

<span>text</span>

No formatting. • This tag can be used to specify visual styles, by adding a class attribute. • This tag is used to create Structured objects.

class: color options. data-entity-id • See below for list of translated PresentationML attributes.

<code>code sample</code>

Format the text as a block of code.

  • language: Use the language attribute to benefit from language specific code highlighting. The following languages are available: c, cpp, csharp, css, html, java, js, jsx, php, python, r, typescript, tsx, plaintext, yaml, scala, json, shell, markdown

  • Note: language attribute is only available with Agent 20.14+.

  • Note: please see escaping rules for Special Characters when using code tag

Examples

Here after you can find an example of a message sent by a bot and containing these formatting and semantics tags as well as the structure of the messageML sent:

Versions and Compatibility

Main features introduced

Agent needed to parse message sent by the bot

Client 2.0 release

Backward client-compatibility behavior (e.g. external rooms)

Client 1.5 release

Initial release

Since the first version

Since the first version

-

Since the first version

Closing <b> and <i> without line breaks*

Since the first version

Since the first version

-

1.53

Support of the language attribute on <code> blocks.

Agent 20.14

Since the first version

-

Last updated