/*\ title: $:/core/modules/deserializers.js type: application/javascript module-type: tiddlerdeserializer Functions to deserialise tiddlers from a block of text \*/ (function(){ /*jslint node: true, browser: true */ /*global $tw: false */ "use strict"; exports["application/x-tiddler-html-div"] = function(text,fields) { return [deserializeTiddlerDiv(text,fields)]; }; exports["application/json"] = function(text,fields) { var incoming, results = []; try { incoming = JSON.parse(text); } catch(e) { incoming = [{ title: "JSON error: " + e, text: "" }] } if(!$tw.utils.isArray(incoming)) { incoming = [incoming]; } for(var t=0; t/gi, storeAreaMatch = storeAreaMarkerRegExp.exec(text); if(storeAreaMatch) { // If so, we've got tiddlers in classic TiddlyWiki format or unencrypted old-style TW5 format results.push.apply(results,deserializeStoreArea(text,storeAreaMarkerRegExp.lastIndex,!!storeAreaMatch[1],fields)); } // Check for new-style store areas var newStoreAreaMarkerRegExp = /