Skip to content

Text

Two attributes replace an element's body with a value: tl:text escapes the result, and tl:utext inserts it as raw HTML.

tl:text – escaped text

tl:text replaces the element's content with the value of an expression, HTML-escaping it. This is the safe default and guards against XSS:

<p tl:text="${message}">placeholder</p>

Rendering with {'message': 'Hello & welcome'} produces:

<p>Hello &amp; welcome</p>

The placeholder (placeholder) is only shown when the raw template is opened in a browser without rendering; tl:text replaces it at render time.

tl:utext – unescaped HTML

tl:utext inserts the value as raw, unescaped HTML into the element body. The value is output, not template code: tl:* attributes inside it are emitted as-is. Use it only with content you trust, since it does not protect against XSS:

<div tl:utext="${richContent}">placeholder</div>

With {'richContent': '<strong>Bold</strong>'} this renders:

<div><strong>Bold</strong></div>

Security: tl:text always escapes and is safe for user-supplied data. Reserve tl:utext for trusted, pre-sanitized HTML.