Plain Text

In Haml and Slim templates, plain text can be written directly as template content. EGO templates use normal HTML text.

This is plain text

renders as:

This is plain text

Plain text can also follow a tag.

%p This is plain text

renders as:

<p>This is plain text</p>

HTML

In Haml and Slim templates, HTML mixed into plain text is treated as text and rendered as is.

%p
  This is plain text
  <strong>and HTML is too</strong>

renders as:

<p>
  This is plain text <strong>and HTML is too</strong>
</p>

You’ve put thought into what you’ve written into the text. GoHT will respect that and render it as is.

Escaping

Because Haml and Slim use prefixes to indicate the type of content, you may need to escape those prefixes from time to time. This is done by using the backslash \ character.

%p
  This element was created with a
  \%p tag followed by some plain text

renders as:

<p>
  This element was created with a %p tag followed by some plain text
</p>

The backslash \ character is used to escape the % character, and any other character that GoHT recognizes as a prefix. You will only need to use the backslash \ character at the beginning of a line.

GoHT will not try to parse the content looking for prefixes in the middle of your content.

%p
  GoHT won't treat %p as a tag in the middle of a line

renders as:

<p>
  GoHT won't treat %p as a tag in the middle of a line
</p>