mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-23 18:17:20 +00:00
d6e531e87c
And add an image parser and a plain text parser
32 lines
596 B
JavaScript
32 lines
596 B
JavaScript
/*\
|
|
title: $:/core/modules/parsers/textparser.js
|
|
type: application/javascript
|
|
module-type: newparser
|
|
|
|
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/javascript"] = TextParser;
|
|
|
|
})();
|
|
|