Use a JSON tiddler for $:/config/OriginalTiddlerPaths

Otherwise things go wrong when we have tiddler titles containing colons
print-window-tiddler
Jermolene 2014-08-20 10:11:40 +01:00
rodzic 1075bd2084
commit c912fed55d
1 zmienionych plików z 3 dodań i 3 usunięć

Wyświetl plik

@ -1593,11 +1593,11 @@ $tw.loadWikiTiddlers = function(wikiPath,parentPaths) {
// Save the original tiddler file locations if requested
var config = wikiInfo.config || {};
if(config["retain-original-tiddler-path"]) {
var output = [];
var output = {};
for(var title in $tw.boot.files) {
output.push(title + ": " + path.relative(resolvedWikiPath,$tw.boot.files[title].filepath) + "\n");
output[title] = path.relative(resolvedWikiPath,$tw.boot.files[title].filepath);
}
$tw.wiki.addTiddler({title: "$:/config/OriginalTiddlerPaths", type: "application/x-tiddler-dictionary", text: output.join("")});
$tw.wiki.addTiddler({title: "$:/config/OriginalTiddlerPaths", type: "application/json", text: JSON.stringify(output)});
}
// Save the path to the tiddlers folder for the filesystemadaptor
$tw.boot.wikiTiddlersPath = path.resolve($tw.boot.wikiPath,config["default-tiddler-location"] || $tw.config.wikiTiddlersSubDir);