Skip to content

Commit 6f40279

Browse files
committed
fix: - Allow multiple spaces after onCompletion emoji
1 parent a699a5e commit 6f40279

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/TaskSerializer/DefaultTaskSerializer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ export const DEFAULT_SYMBOLS: DefaultTaskSerializerSymbols = {
9191
doneDateRegex: / *(\d{4}-\d{2}-\d{2})$/u,
9292
cancelledDateRegex: / *(\d{4}-\d{2}-\d{2})$/u,
9393
recurrenceRegex: /🔁 ?([a-zA-Z0-9, !]+)$/iu,
94-
onCompletionRegex: /🏁 ?([a-zA-Z]+)$/iu,
94+
onCompletionRegex: /🏁 *([a-zA-Z]+)$/iu,
9595
dependsOnRegex: new RegExp('⛔\uFE0F? *(' + taskIdSequenceRegex.source + ')$', 'iu'),
9696
idRegex: new RegExp('🆔 *(' + taskIdRegex.source + ')$', 'iu'),
9797
},

tests/TaskSerializer/DefaultTaskSerializer.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ describe('validate emoji regular expressions', () => {
7171
doneDateRegex: /✅ *(\\d{4}-\\d{2}-\\d{2})$/u
7272
cancelledDateRegex: /❌ *(\\d{4}-\\d{2}-\\d{2})$/u
7373
recurrenceRegex: /🔁 ?([a-zA-Z0-9, !]+)$/iu
74-
onCompletionRegex: /🏁 ?([a-zA-Z]+)$/iu
74+
onCompletionRegex: /🏁 *([a-zA-Z]+)$/iu
7575
dependsOnRegex: /⛔️? *([a-zA-Z0-9-_]+( *, *[a-zA-Z0-9-_]+ *)*)$/iu
7676
idRegex: /🆔 *([a-zA-Z0-9-_]+)$/iu"
7777
`);
@@ -175,7 +175,7 @@ describe.each(symbolMap)("DefaultTaskSerializer with '$taskFormat' symbols", ({
175175
expect(taskDetails).toMatchTaskDetails({ onCompletion: OnCompletion.Delete });
176176
});
177177

178-
it.failing('should allow multiple spaces', () => {
178+
it('should allow multiple spaces', () => {
179179
const onCompletion = `${onCompletionSymbol} Keep`;
180180
const taskDetails = deserialize(onCompletion);
181181
expect(taskDetails).toMatchTaskDetails({ onCompletion: OnCompletion.Keep });

0 commit comments

Comments
 (0)