merge
Whitespace inside the braces is ignored, so {{name}} and {{ name }} are the same placeholder. A key that the object does not carry is left as it stands, which makes a missing value visible rather than silently blank; onMissing: "empty" removes it instead.
escape takes a function applied to every substituted value — pass escapeHtml when the result goes into a page.
Parameters
Parameter | Type | Description |
|---|---|---|
|
| The template string with |
|
| The object the values come from. |
|
|
|
Returns
string — the template with its placeholders filled.
Throws
Exception | Condition |
|---|---|
| the template is not a string, or the data is not an object. |
Examples
Filling a template
See also
Source
This documentation was generated with AI (Claude) from the library's source code.