Permalink
Browse files

reformat type json example

  • Loading branch information...
1 parent 5e6fd59 commit 9aa00f13b40719394806bcb7f6728a1298bd41b1 @Alphmega Alphmega committed Feb 23, 2016
Showing with 13 additions and 0 deletions.
  1. +13 −0 template/utils/handlebars_helper.js
@@ -201,6 +201,19 @@ define([
/**
*
*/
+ Handlebars.registerHelper('reformat', function(source, type){
+ if (type == 'json')
+ try {
+ return JSON.stringify(JSON.parse(source.trim()),null, " ");
+ } catch(e) {
+
+ }
+ return source
+ });
+
+ /**
+ *
+ */
Handlebars.registerHelper('showDiff', function(source, compare, options) {
var ds = '';
if(source === compare) {

0 comments on commit 9aa00f1

Please sign in to comment.