mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-02-23 14:30:02 +00:00
Basic serializers
This commit is contained in:
parent
079e0e2d1e
commit
09d7a7fd72
24
rabbithole/core/modules/serializers.js
Normal file
24
rabbithole/core/modules/serializers.js
Normal file
@ -0,0 +1,24 @@
|
||||
/*\
|
||||
title: $:/core/modules/serializers.js
|
||||
type: application/javascript
|
||||
module-type: tiddlerserializer
|
||||
|
||||
Plugins to serialise tiddlers to a block of text
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
exports["text/plain"] = function(tiddler) {
|
||||
return tiddler ? tiddler.fields.text : "";
|
||||
};
|
||||
|
||||
exports["text/html"] = function(tiddler) {
|
||||
var text = this.renderTiddler("text/html",tiddler.fields.title);
|
||||
return text ? text : "";
|
||||
};
|
||||
|
||||
})();
|
Loading…
x
Reference in New Issue
Block a user