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:
|
|
|
|
|
|
|
|
{{#transform}}{{{file.content.html}}}{{/transform}}
|
2017-09-17 15:32:39 +00:00
|
|
|
*/
|
2017-09-23 19:01:50 +00:00
|
|
|
|