Text formatting

Most data within Metrici can be formatted.

Metrici supports both plain text, and formatting marked up in HTML.

Plain text

Plain text you type into Metrici will be shown as is. Line breaks and line indentations using spaces (and more than one space wide) will be preserved.

The only thing to watch out for are the < and & characters, which have special meaning. It is safest to use &lt; and &amp; in place of < and &.

You can add special characters using HTML entities (such as &copy;), or numeric entities (such as &#160;).

HTML markup

You can add HTML markup to your text. Nearly all HTML markup is allowed, but any scripts will be removed.

Metrici will "mend" any broken HTML before it outputs it. This may mean that some of the text is not exactly as you had envisaged.

Whitespace-only sequences between HTML elements are ignored.

Within HTML elements, line breaks and indentation are ignored, i.e. plain text formatting only applies to top-level text, not text within elements. You will need to add <br/> or <p>..</p> sequences to the text.

If you mix plain text formatting and HTML markup, then any newlines which immediately precede or follow HTML markup will be removed. This is generally what you want, as in the example below where it prevents extra lines appearing around the list:

My list:
<ul>
  <li>Item 1</li>
  <li>Item 2</li>
</ul>
Some more text

This gives:

My list:
  • Item 1
  • Item 2
Some more text

Rather than:

My list:
  • Item 1
  • Item 2

Some more text

However, this rule also means inline formatting may disrupt line breaks. For example:

<a href="#">My link</a>
Some more text

Gives:

My linkSome more text

To force a break, use the <br/> element:

<a href="#">My link</a><br/>
Some more text

API

Text entered through Metrici is automatically formatted and filtered before it is output. You can perform the filtering from scripts using the Script Application filterHTML() method.