From 186d67351705cfb99442ee3bea8fe11ea39ba20e Mon Sep 17 00:00:00 2001 From: Pol Date: Tue, 14 Apr 2015 17:01:01 +0200 Subject: [PATCH] Add the commas to the prettified JSON I recently came across that when copying the prettified response there were no comma separating the elements. This solves this problem. --- Resources/views/layout.html.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Resources/views/layout.html.twig b/Resources/views/layout.html.twig index ef5487f..6466040 100755 --- a/Resources/views/layout.html.twig +++ b/Resources/views/layout.html.twig @@ -319,7 +319,7 @@ prettifiedJsonString = prettifiedJsonString.replace(/(\{|\[)\n/g, function(match, sectionOpenCharacter) { return getJsonCollapseHtml(sectionOpenCharacter) + '\n'; }); - return prettifiedJsonString.replace(/([^\[][\}\]]),?\n/g, '$1\n'); + return prettifiedJsonString.replace(/([^\[][\}\]])(,)?\n/g, '$1$2\n'); }; var prettifyResponse = function(text) {