mirror of
https://github.com/johannesjo/super-productivity.git
synced 2026-07-31 11:40:47 +00:00
fix(shortSyntax): "asd #asd" case
This commit is contained in:
parent
5224491390
commit
d8d5ae78ab
2 changed files with 20 additions and 1 deletions
|
|
@ -185,6 +185,24 @@ describe('shortSyntax', () => {
|
|||
});
|
||||
});
|
||||
|
||||
it('should add new "asd #asd" tag', () => {
|
||||
const t = {
|
||||
...TASK,
|
||||
title: 'asd #asd',
|
||||
tagIds: []
|
||||
};
|
||||
const r = shortSyntax(t, ALL_TAGS);
|
||||
|
||||
expect(r).toEqual({
|
||||
newTagTitles: ['asd'],
|
||||
remindAt: null,
|
||||
projectId: undefined,
|
||||
taskChanges: {
|
||||
title: 'asd',
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
it('should not add tags for sub tasks', () => {
|
||||
const t = {
|
||||
...TASK,
|
||||
|
|
|
|||
|
|
@ -126,7 +126,8 @@ const parseTagChanges = (task: Partial<TaskCopy>, allTags?: Tag[]): { taskChange
|
|||
.map(title => title.trim().replace(CH_TAG, ''))
|
||||
.filter(newTagTitle =>
|
||||
newTagTitle.length >= 1
|
||||
&& initialTitle.trim().indexOf(newTagTitle) > 4
|
||||
// NOTE: we check this to not trigger for "#123 blasfs dfasdf"
|
||||
&& initialTitle.trim().lastIndexOf(newTagTitle) > 4
|
||||
);
|
||||
|
||||
const tagIdsToAdd: string[] = [];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue