mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-15 22:34:51 +00:00
Extended wiki.serializeTiddler to take a Tiddler() object as well as a title
This commit is contained in:
parent
b91ccb064b
commit
3da810b2b3
@ -118,9 +118,14 @@ exports.addTiddler = function(tiddler) {
|
||||
this.touchTiddler(title);
|
||||
};
|
||||
|
||||
exports.serializeTiddler = function(title,type) {
|
||||
var serializer = $tw.Wiki.tiddlerSerializerPlugins[type],
|
||||
tiddler = this.getTiddler(title);
|
||||
/*
|
||||
Serialise a tiddler to a specified text serialization format
|
||||
*/
|
||||
exports.serializeTiddler = function(tiddler,type) {
|
||||
var serializer = $tw.Wiki.tiddlerSerializerPlugins[type];
|
||||
if(typeof tiddler === "string") {
|
||||
tiddler = this.getTiddler(tiddler);
|
||||
}
|
||||
if(serializer && tiddler) {
|
||||
return serializer.call(this,tiddler);
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user