From bb34fee40ccfe06829b9df058944d579ee2e0290 Mon Sep 17 00:00:00 2001 From: "Ibrahima G. Coulibaly" Date: Sun, 23 Jun 2024 23:55:30 +0100 Subject: [PATCH] Revert "Fix checkboxes in join string" --- src/components/ToolsExamples.tsx | 0 src/pages/string/join/service.ts | 14 ++------------ 2 files changed, 2 insertions(+), 12 deletions(-) delete mode 100644 src/components/ToolsExamples.tsx diff --git a/src/components/ToolsExamples.tsx b/src/components/ToolsExamples.tsx deleted file mode 100644 index e69de29..0000000 diff --git a/src/pages/string/join/service.ts b/src/pages/string/join/service.ts index b736dd6..e636238 100644 --- a/src/pages/string/join/service.ts +++ b/src/pages/string/join/service.ts @@ -5,23 +5,13 @@ export function mergeText( joinCharacter: string = '' ): string { let processedLines: string[] = text.split('\n'); - if (deleteTrailingSpaces) { processedLines = processedLines.map((line) => line.trimEnd()); } if (deleteBlankLines) { - processedLines = processedLines.filter((line) => line.trim() !== ''); - } else { - processedLines = processedLines.map((line) => - line.trim() === '' ? line + '\r\n\n' : line - ); + processedLines = processedLines.filter((line) => line.trim()); } + return processedLines.join(joinCharacter); } - -// Example text to use -`This is a line with trailing spaces -Another line with trailing spaces - -Final line without trailing spaces`;