1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-07-06 20:12:49 +00:00

Better error checking for reading field lists

This change ensures that lines starting with a colon are ignored,
allowing them to be used as comments.
This commit is contained in:
Jermolene 2015-05-07 19:24:58 +01:00
parent 3644462a80
commit e9a1a53922

View File

@ -294,9 +294,11 @@ $tw.utils.parseFields = function(text,fields) {
if(p !== -1) { if(p !== -1) {
var field = line.substr(0, p).trim(), var field = line.substr(0, p).trim(),
value = line.substr(p+1).trim(); value = line.substr(p+1).trim();
if(field) {
fields[field] = value; fields[field] = value;
} }
} }
}
}); });
return fields; return fields;
}; };