Ensure system tiddlers are imported

We no longer generate a separate “systemArea” for system tiddlers but
we still need to import it for older wikis
print-window-tiddler
Jermolene 2013-12-02 09:57:54 +00:00
rodzic 026a27c1ab
commit 7a4abba9fd
1 zmienionych plików z 9 dodań i 1 usunięć

Wyświetl plik

@ -96,7 +96,15 @@ exports["text/html"] = function(text,fields) {
match = storeAreaMarkerRegExp.exec(text); match = storeAreaMarkerRegExp.exec(text);
if(match) { if(match) {
// If so, it's either a classic TiddlyWiki file or a TW5 file // 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 = /<div id=["']?systemArea['"]?( style=["']?display:none;["']?)?>/gi,
sysMatch = systemAreaMarkerRegExp.exec(text);
if(sysMatch) {
results.push.apply(results,deserializeTiddlyWikiFile(text,systemAreaMarkerRegExp.lastIndex,!!sysMatch[1],fields));
}
return results
} else { } else {
// It's not a TiddlyWiki so we'll return the entire HTML file as a tiddler // It's not a TiddlyWiki so we'll return the entire HTML file as a tiddler
return deserializeHtmlFile(text,fields); return deserializeHtmlFile(text,fields);