From f389260eb5a0be30c8529e01909426bed38bb719 Mon Sep 17 00:00:00 2001 From: Shubhendu Madhukar Date: Fri, 4 Aug 2023 21:36:39 +0530 Subject: [PATCH] fix: fix bug caused by preserve new line feat #227 --- src/parser/HttpParser.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/parser/HttpParser.ts b/src/parser/HttpParser.ts index 8d95eac..6e33c94 100644 --- a/src/parser/HttpParser.ts +++ b/src/parser/HttpParser.ts @@ -181,9 +181,9 @@ export class HttpParser { responseBody = responseBody.replace(/\s+/g, " ").trim(); responseBody = responseBody.replace(/{{{/, "{ {{"); responseBody = responseBody.replace(/}}}/, "}} }"); + responseBody = responseBody.split("
").join("\n").trim() const template = Handlebars.compile(responseBody); try { - responseBody = responseBody.split("
").join("\n").trim() const codeResponse = JSON.parse( responseBody.replace(/"/g, '"') ); @@ -240,12 +240,10 @@ export class HttpParser { logger: logger, })}` ); - response.body = await template({ request: this.req, logger: logger, }); - response.body = response.body.split("
").join("\n").trim() return response; break; } @@ -262,7 +260,6 @@ export class HttpParser { request: this.req, logger: logger, }); - response.body = response.body.split("
").join("\n").trim() return response; } response.body = responseBody;