2012-05-03 20:47:16 +00:00
|
|
|
/*\
|
|
|
|
title: $:/core/modules/deserializers.js
|
|
|
|
type: application/javascript
|
|
|
|
module-type: tiddlerdeserializer
|
|
|
|
|
2012-05-05 10:18:47 +00:00
|
|
|
Plugins to deserialise tiddlers from a block of text
|
2012-05-03 20:47:16 +00:00
|
|
|
|
|
|
|
\*/
|
|
|
|
(function(){
|
|
|
|
|
2012-05-04 17:49:04 +00:00
|
|
|
/*jslint node: true, browser: true */
|
|
|
|
/*global $tw: false */
|
2012-05-03 20:47:16 +00:00
|
|
|
"use strict";
|
|
|
|
|
|
|
|
exports["text/plain"] = function(text,fields) {
|
2012-05-05 10:18:47 +00:00
|
|
|
fields.text = text;
|
|
|
|
fields.type = "text/plain";
|
|
|
|
return [fields];
|
2012-05-03 20:47:16 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
exports["text/html"] = function(text,fields) {
|
2012-05-05 10:18:47 +00:00
|
|
|
fields.text = text;
|
|
|
|
fields.type = "text/html";
|
|
|
|
return [fields];
|
2012-05-03 20:47:16 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
})();
|