fix: ensure all matched quick add magic parts are correctly removed from the task
This commit is contained in:
parent
4ff0c81e37
commit
7b6a13dd52
@ -280,13 +280,16 @@ const getRepeats = (text: string): repeatParsedResult => {
|
|||||||
|
|
||||||
export const cleanupItemText = (text: string, items: string[], prefix: string): string => {
|
export const cleanupItemText = (text: string, items: string[], prefix: string): string => {
|
||||||
items.forEach(l => {
|
items.forEach(l => {
|
||||||
|
if (l === '') {
|
||||||
|
return
|
||||||
|
}
|
||||||
text = text
|
text = text
|
||||||
.replace(`${prefix}'${l}' `, '')
|
.replace(new RegExp(`\\${prefix}'${l}' `, 'ig'), '')
|
||||||
.replace(`${prefix}'${l}'`, '')
|
.replace(new RegExp(`\\${prefix}'${l}'`, 'ig'), '')
|
||||||
.replace(`${prefix}"${l}" `, '')
|
.replace(new RegExp(`\\${prefix}"${l}" `, 'ig'), '')
|
||||||
.replace(`${prefix}"${l}"`, '')
|
.replace(new RegExp(`\\${prefix}"${l}"`, 'ig'), '')
|
||||||
.replace(`${prefix}${l} `, '')
|
.replace(new RegExp(`\\${prefix}${l} `, 'ig'), '')
|
||||||
.replace(`${prefix}${l}`, '')
|
.replace(new RegExp(`\\${prefix}${l}`, 'ig'), '')
|
||||||
})
|
})
|
||||||
return text
|
return text
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user