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);