1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-27 03:57:21 +00:00

Improve checking for missing titles

This commit is contained in:
Jermolene 2016-11-14 15:37:55 +00:00
parent a485eb8588
commit 903cdc09cc

View File

@ -104,6 +104,10 @@ XLSXImporter.prototype.processRowByColumn = function() {
self.tiddlerFields[name] = cell.w;
}
});
// Skip the tiddler entirely if it doesn't have a title
if(!this.tiddlerFields.title) {
this.skipTiddler = true;
}
};
XLSXImporter.prototype.processRowByField = function() {
@ -139,12 +143,6 @@ XLSXImporter.prototype.processField = function(fieldImportSpecTitle) {
value = fieldImportSpec.fields["import-field-value"]
break;
}
if(fieldImportSpec.fields["import-field-prefix"]) {
value = fieldImportSpec.fields["import-field-prefix"] + value;
}
if(fieldImportSpec.fields["import-field-suffix"]) {
value = value + fieldImportSpec.fields["import-field-suffix"];
}
if((value || "").trim() === "") {
if((fieldImportSpec.fields["import-field-skip-tiddler-if-blank"] || "").trim().toLowerCase() === "yes") {
this.skipTiddler = true;
@ -153,6 +151,12 @@ XLSXImporter.prototype.processField = function(fieldImportSpecTitle) {
value = fieldImportSpec.fields["import-field-replace-blank"];
}
}
if(fieldImportSpec.fields["import-field-prefix"]) {
value = fieldImportSpec.fields["import-field-prefix"] + value;
}
if(fieldImportSpec.fields["import-field-suffix"]) {
value = value + fieldImportSpec.fields["import-field-suffix"];
}
switch(fieldImportSpec.fields["import-field-list-op"] || "none") {
case "none":
this.tiddlerFields[fieldName] = value;