1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-11-15 14:57:42 +00:00

Refine the way that we support serialised external tiddler files

The old way was sufficiently backwards compatible that it was
impossible to use TiddlyWiki 5.1.9 to build the tw5.com edition.
This commit is contained in:
Jermolene
2015-07-28 19:56:56 +01:00
parent 273daa9613
commit 73210a7b8c
3 changed files with 45 additions and 25 deletions

View File

@@ -1464,9 +1464,9 @@ $tw.loadTiddlersFromPath = function(filepath,excludeRegExp) {
$tw.utils.each(filesInfo.tiddlers,function(tidInfo) {
var type = tidInfo.fields.type || "text/plain",
typeInfo = $tw.config.contentTypeInfo[type],
pathname = path.resolve(filepath,tidInfo.file || tidInfo.tiddlerFile),
pathname = path.resolve(filepath,tidInfo.file),
text = fs.readFileSync(pathname,typeInfo ? typeInfo.encoding : "utf8");
if(tidInfo.tiddlerFile) {
if(tidInfo.isTiddlerFile) {
var fileTiddlers = $tw.wiki.deserializeTiddlers(path.extname(pathname),text) || [];
$tw.utils.each(fileTiddlers,function(tiddler) {
$tw.utils.extend(tiddler,tidInfo.fields);