Plain Text
In Haml templates, plain text can be written directly as template content. EGO templates use normal HTML text. Slim needs one extra marker for a standalone line of text; see Slim text blocks below.
renders as:
Plain text can also follow a tag, in both Haml and Slim.
renders as:
Slim text blocks
Slim tag names are bare words, so a standalone line starting with a letter is parsed as a tag, not as text. To write a standalone line of plain text in Slim, prefix it with a pipe | character.
renders as:
Leaving off the | changes the meaning instead of raising an error. This is plain text on its own line would be parsed as a <This> tag containing the text is plain text. Always mark standalone text lines with | in Slim, even when they read like ordinary sentences.
Text written after a tag on the same line, like p This is plain text above, does not need the | marker; the ambiguity only exists for a line that starts with the text itself.
HTML
In Haml and Slim templates, HTML mixed into plain text is treated as text and rendered as is.
renders as:
You’ve put thought into what you’ve written into the text. GoHT will respect that and render it as is.
Escaping
Haml only. Because Haml uses 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.
renders as:
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.
renders as:
Slim doesn’t have or need a backslash escape: since every standalone text line already requires the | marker described above, there’s no ambiguous prefix character to escape.