2012-12-27 17:08:29 +00:00
|
|
|
/*\
|
|
|
|
title: $:/core/modules/parsers/textparser.js
|
|
|
|
type: application/javascript
|
2013-01-16 13:56:11 +00:00
|
|
|
module-type: parser
|
2012-12-27 17:08:29 +00:00
|
|
|
|
|
|
|
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;
|
2013-04-02 17:20:38 +00:00
|
|
|
exports["application/vnd.tiddlywiki2"] = TextParser;
|
2012-12-27 17:08:29 +00:00
|
|
|
exports["application/javascript"] = TextParser;
|
2013-03-19 18:26:55 +00:00
|
|
|
exports["application/json"] = TextParser;
|
2012-12-27 17:08:29 +00:00
|
|
|
|
|
|
|
})();
|
|
|
|
|