Skip to content

Commit

Permalink
fix: fix bug caused by preserve new line feat #227
Browse files Browse the repository at this point in the history
  • Loading branch information
shubhendumadhukar committed Aug 4, 2023
1 parent 9957355 commit f389260
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/parser/HttpParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,9 @@ export class HttpParser {
responseBody = responseBody.replace(/\s+/g, " ").trim();
responseBody = responseBody.replace(/{{{/, "{ {{");
responseBody = responseBody.replace(/}}}/, "}} }");
responseBody = responseBody.split("<br/>").join("\n").trim()
const template = Handlebars.compile(responseBody);
try {
responseBody = responseBody.split("<br/>").join("\n").trim()
const codeResponse = JSON.parse(
responseBody.replace(/&quot;/g, '"')
);
Expand Down Expand Up @@ -240,12 +240,10 @@ export class HttpParser {
logger: logger,
})}`
);

response.body = await template({
request: this.req,
logger: logger,
});
response.body = response.body.split("<br />").join("\n").trim()
return response;
break;
}
Expand All @@ -262,7 +260,6 @@ export class HttpParser {
request: this.req,
logger: logger,
});
response.body = response.body.split("<br/>").join("\n").trim()
return response;
}
response.body = responseBody;
Expand Down

0 comments on commit f389260

Please sign in to comment.