1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-06-26 15:23:15 +00:00
TiddlyWiki5/core/modules/parsers/textparser.js
Jeremy Ruston c182533efc Parse TiddlyWiki classic wikitext as plain text
Too many errors if we try to parse it as TW5 wikitext
2013-04-02 18:20:38 +01:00

34 lines
688 B
JavaScript

/*\
title: $:/core/modules/parsers/textparser.js
type: application/javascript
module-type: parser
The plain text parser processes blocks of source text into a degenerate parse tree consisting of a single text node
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
var TextParser = function(type,text,options) {
this.tree = [{
type: "element",
tag: "pre",
children: [{
type: "text",
text: text
}]
}];
};
exports["text/plain"] = TextParser;
exports["text/html"] = TextParser;
exports["application/vnd.tiddlywiki2"] = TextParser;
exports["application/javascript"] = TextParser;
exports["application/json"] = TextParser;
})();