mirror of
https://github.com/Jermolene/TiddlyWiki5.git
synced 2026-03-11 09:12:00 -07:00
28 lines
776 B
JavaScript
28 lines
776 B
JavaScript
/*\
|
|
title: $:/core/modules/parsers/textparser.js
|
|
type: application/javascript
|
|
module-type: parser
|
|
\*/
|
|
|
|
"use strict";
|
|
|
|
var TextParser = function(type,text,options) {
|
|
this.tree = [{
|
|
type: "genesis",
|
|
attributes: {
|
|
$type: {name: "$type", type: "string", value: "$codeblock"},
|
|
code: {name: "code", type: "string", value: text},
|
|
language: {name: "language", type: "string", value: type},
|
|
$remappable: {name: "$remappable", type:"string", value: "no"}
|
|
}
|
|
}];
|
|
this.source = text;
|
|
this.type = type;
|
|
};
|
|
|
|
exports["text/plain"] = TextParser;
|
|
exports["text/x-tiddlywiki"] = TextParser;
|
|
exports["application/javascript"] = TextParser;
|
|
exports["application/json"] = TextParser;
|
|
exports["text/css"] = TextParser;
|
|
exports["application/x-tiddler-dictionary"] = TextParser;
|