1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-26 19:47:20 +00:00

When we deserialize an unknown type as "text/plain" we should mark it with the original type

This commit is contained in:
Jeremy Ruston 2013-04-01 18:55:49 +01:00
parent 74e5e127c0
commit a75fd3df34

View File

@ -636,7 +636,7 @@ $tw.Wiki.prototype.deserializeTiddlers = function(type,text,srcFields) {
fields[f] = srcFields[f];
}
if(deserializer) {
return deserializer.call(this,text,fields);
return deserializer.call(this,text,fields,type);
} else {
// Return a raw tiddler for unknown types
fields.text = text;
@ -673,9 +673,9 @@ $tw.modules.define("$:/boot/tiddlerdeserializer/tid","tiddlerdeserializer",{
}
});
$tw.modules.define("$:/boot/tiddlerdeserializer/txt","tiddlerdeserializer",{
"text/plain": function(text,fields) {
"text/plain": function(text,fields,type) {
fields.text = text;
fields.type = "text/plain";
fields.type = type || "text/plain";
return [fields];
}
});