2017-09-17 15:32:39 +00:00
|
|
|
/* Add your custom Handlebars helpers here.
|
|
|
|
|
|
|
|
For example:
|
2017-10-02 22:48:01 +00:00
|
|
|
|
2017-09-17 15:32:39 +00:00
|
|
|
Handlebars.registerHelper('transform', function (options) {
|
|
|
|
var result = options.fn(this);
|
|
|
|
return new Handlebars.SafeString(
|
|
|
|
result.replace(/<pre[^>]*>/g, '<pre class="prettyprint">')
|
|
|
|
);
|
|
|
|
});
|
2017-10-02 22:48:01 +00:00
|
|
|
|
|
|
|
Then use the helper in your template:
|
|
|
|
|
2018-02-07 21:25:29 +00:00
|
|
|
{{#transform}}{{{files.0.content.html}}}{{/transform}}
|
2017-09-17 15:32:39 +00:00
|
|
|
*/
|
2017-09-23 19:01:50 +00:00
|
|
|
|