mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-09 19:39:57 +00:00
41db3d89ae
We could display the HTML in an IFRAME but I think that's often not what people want
27 lines
551 B
JavaScript
27 lines
551 B
JavaScript
/*\
|
|
title: $:/core/modules/parsers/plaintextparser.js
|
|
type: application/javascript
|
|
module-type: parser
|
|
|
|
Parses plain text tiddlers
|
|
|
|
\*/
|
|
(function(){
|
|
|
|
/*jslint node: true, browser: true */
|
|
/*global $tw: false */
|
|
"use strict";
|
|
|
|
var PlainTextParser = function(options) {
|
|
this.wiki = options.wiki;
|
|
};
|
|
|
|
PlainTextParser.prototype.parse = function(type,text) {
|
|
return new $tw.Renderer([$tw.Tree.Element("pre",{},[$tw.Tree.Text(text)])],new $tw.Dependencies());
|
|
};
|
|
|
|
exports["text/plain"] = PlainTextParser;
|
|
exports["text/html"] = PlainTextParser;
|
|
|
|
})();
|