From 7a4abba9fda630edac86c3a572dad502b1435503 Mon Sep 17 00:00:00 2001 From: Jermolene Date: Mon, 2 Dec 2013 09:57:54 +0000 Subject: [PATCH] Ensure system tiddlers are imported MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We no longer generate a separate “systemArea” for system tiddlers but we still need to import it for older wikis --- core/modules/deserializers.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/core/modules/deserializers.js b/core/modules/deserializers.js index d219b5289..46d060ccb 100644 --- a/core/modules/deserializers.js +++ b/core/modules/deserializers.js @@ -96,7 +96,15 @@ exports["text/html"] = function(text,fields) { match = storeAreaMarkerRegExp.exec(text); if(match) { // If so, it's either a classic TiddlyWiki file or a TW5 file - return deserializeTiddlyWikiFile(text,storeAreaMarkerRegExp.lastIndex,!!match[1],fields); + // First read the normal tiddlers + var results = deserializeTiddlyWikiFile(text,storeAreaMarkerRegExp.lastIndex,!!match[1],fields); + // Then any system tiddlers + var systemAreaMarkerRegExp = /
/gi, + sysMatch = systemAreaMarkerRegExp.exec(text); + if(sysMatch) { + results.push.apply(results,deserializeTiddlyWikiFile(text,systemAreaMarkerRegExp.lastIndex,!!sysMatch[1],fields)); + } + return results } else { // It's not a TiddlyWiki so we'll return the entire HTML file as a tiddler return deserializeHtmlFile(text,fields);