mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-02-22 22:10:03 +00:00
Make $tw.utils.stringifyList() resilient to null values in the array
This commit is contained in:
parent
b867b7487e
commit
20daaae7e8
19
boot/boot.js
19
boot/boot.js
@ -251,15 +251,20 @@ $tw.utils.parseDate = function(value) {
|
||||
|
||||
// Stringify an array of tiddler titles into a list string
|
||||
$tw.utils.stringifyList = function(value) {
|
||||
var result = [];
|
||||
for(var t=0; t<value.length; t++) {
|
||||
if(value[t].indexOf(" ") !== -1) {
|
||||
result.push("[[" + value[t] + "]]");
|
||||
} else {
|
||||
result.push(value[t]);
|
||||
if($tw.utils.isArray(value)) {
|
||||
var result = [];
|
||||
for(var t=0; t<value.length; t++) {
|
||||
var entry = value[t] || "";
|
||||
if(entry.indexOf(" ") !== -1) {
|
||||
result.push("[[" + entry + "]]");
|
||||
} else {
|
||||
result.push(entry);
|
||||
}
|
||||
}
|
||||
return result.join(" ");
|
||||
} else {
|
||||
return value || "";
|
||||
}
|
||||
return result.join(" ");
|
||||
};
|
||||
|
||||
// Parse a string array from a bracketted list. For example "OneTiddler [[Another Tiddler]] LastOne"
|
||||
|
Loading…
x
Reference in New Issue
Block a user