From 8507808058262997b44eea124e21e20da8dacf62 Mon Sep 17 00:00:00 2001 From: kolaente Date: Fri, 29 Sep 2023 10:06:38 +0200 Subject: [PATCH] fix(tasks): ignore empty lines when adding multiple tasks at once Resolves https://kolaente.dev/vikunja/frontend/issues/3732#issuecomment-53949 --- src/helpers/parseSubtasksViaIndention.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/helpers/parseSubtasksViaIndention.ts b/src/helpers/parseSubtasksViaIndention.ts index 2a597991a..997b79025 100644 --- a/src/helpers/parseSubtasksViaIndention.ts +++ b/src/helpers/parseSubtasksViaIndention.ts @@ -17,7 +17,9 @@ const spaceRegex = /^ */ * relation between each other. */ export function parseSubtasksViaIndention(taskTitles: string, prefixMode: PrefixMode): TaskWithParent[] { - let titles = taskTitles.split(/[\r\n]+/) + let titles = taskTitles + .split(/[\r\n]+/) + .filter(t => t.replace(/\s/g, '').length > 0) // Remove titles which are empty or only contain spaces / tabs if (titles.length == 0) { return []