{{{expression}}}
Insert the unescaped value of the expression into the output of the template.
{{{EXPRESSION}}}
Behaves just like {{expression}} but does not escape the result.
<div> {{{ toMarkdown(content) }}} </div>
Parameters
- EXPRESSION
{Literal Expression|KeyLookup Expression|Call Expression|Helper Expression}
:An expression whose unescaped result is inserted into the page.
This can also be used to render can-component instances:
import Component from "can-component";
import stache from "can-stache";
const MyGreeting = Component.extend({
tag: "my-greeting",
view: "<p>Hello {{subject}}</p>",
ViewModel: {
subject: "string"
}
});
const myGreetingInstance = new MyGreeting({
viewModel: {
subject: "friend"
}
});
const template = stache("<div>{{{componentInstance}}}</div>");
const fragment = template({
componentInstance: myGreetingInstance
});
fragment; //-> <div><my-greeting><p>Hello friend</p></my-greeting></div>