Skip to content

Commit

Permalink
fix split newline
Browse files Browse the repository at this point in the history
  • Loading branch information
zhixzhan committed Feb 14, 2020
1 parent fc2e1a3 commit 5cd861f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Composer/packages/server/src/models/bot/botProject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -596,10 +596,13 @@ export class BotProject {

private _buildRNNewlineText = (lineArray: string[]): string => {
const lineArrayEndWithRN = lineArray.map(line => {
if (line.endsWith('\r')) {
if (line.endsWith('\r\n')) {
return line;
} else if (line.endsWith('\r')) {
return line + '\n';
} else {
return line + '\r\n';
}
return line;
});
return lineArrayEndWithRN.join('');
};
Expand Down

0 comments on commit 5cd861f

Please sign in to comment.