Follow

Guide to: Using HTML Tags/Characters in Labels

When adding contributor-facing labels to your CML elements, there are instances when you may need to use HTML tags in your label's text, or add markup to style your label.  Since CML labels do not accept HTML Tags, you will need to use "escape characters".  In this article we will explain escape characters and their various uses in CML labels.

What is an escape character?

  • An escape character is an alternative version of a symbol. In HTML, there are some characters that are considered reserved (such as less than (<) and greater than (>) signs, which also signify tags) and must be replaced by using the character’s HTML code name or number, so that the character will be read as a regular character and not a reserved HTML character.
  • Escape characters will always begin with the ampersand symbol (&) and end with a semicolon symbol (;). The characters in between the ampersand and semicolon make up the specific code name or number for a particular character. 
  • The specific code name is the entity name and the code number is the entity number. The entity name and entity number are synonymous in most cases, but some browsers may not support all entity names. Some examples of common escape characters are as follows:
Character Description Entity Name Entity Number
& Ampersand &amp; &#38;
< Less than &lt; &#60;
> Greater than &gt; &#62;
  Non-breaking space &nbsp; &#160;

 

When and how do I use escape characters?

The best time to utilize escape characters is when there are reserved characters within HTML tags and in HTML tag labels. Below are some examples of when and how to use escape characters.

Screen_Shot_2019-07-24_at_10.18.24_AM.png

Screen_Shot_2019-07-24_at_10.17.48_AM.png
*When placing a tag within a tag’s label, change all double quotation marks (“) to single quotation marks (‘)

 
For further reading, please visit: http://www.w3schools.com/html/html_entities.asp


Was this article helpful?
9 out of 13 found this helpful


Have more questions? Submit a request
Powered by Zendesk