1
0
Fork 0
mirror of https://github.com/marty-oehme/scripts.git synced 2024-12-21 15:38:09 +00:00

Fixed bug preveting from importing a task that has no tag.

This commit is contained in:
Filip Makowski 2017-06-19 14:00:27 +02:00
parent 8362f1e9fc
commit d091ee9f0b

View file

@ -302,22 +302,21 @@ QtObject {
tagsSeparated.splice(0, 1); // removing ""
if (tagsSeparated.length === 0) {
logIfVerbose("No tags");
return;
} else {
tagsSeparated.splice(0, 1); // removing headline
tagsSeparated.splice(0, 1); // removing "----"
tagsSeparated.splice(tagsSeparated.length - 1, 1); // removing ""
tagsSeparated.splice(tagsSeparated.length - 1, 1); // removing ""
tagsSeparated.splice(tagsSeparated.length - 1, 1); // removing ""
tagsSeparated.forEach( function(tag){
var tagsRegexp = /[\s*]?(.+)[\s*]?1[\s*]?/i;
var fetchTag = tagsRegexp.exec(tag);
tagsPlainText += " +" + fetchTag[1].replace(/ /g,'');
});
}
tagsSeparated.splice(0, 1); // removing headline
tagsSeparated.splice(0, 1); // removing "----"
tagsSeparated.splice(tagsSeparated.length - 1, 1); // removing ""
tagsSeparated.splice(tagsSeparated.length - 1, 1); // removing ""
tagsSeparated.splice(tagsSeparated.length - 1, 1); // removing ""
tagsSeparated.forEach( function(tag){
var tagsRegexp = /[\s*]?(.+)[\s*]?1[\s*]?/i;
var fetchTag = tagsRegexp.exec(tag);
tagsPlainText += " +" + fetchTag[1].replace(/ /g,'');
});
}
var taskEntry = "* " + fetchTaskParams[2] + tagsPlainText;