mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-23 18:17:20 +00:00
Add an HTML parser
Allows one to embed raw HTML in wikitext with `$$$.html`/`$$$`
This commit is contained in:
parent
0a37f6bf5b
commit
64eadcfc41
25
core/modules/parsers/htmlparser.js
Normal file
25
core/modules/parsers/htmlparser.js
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
/*\
|
||||||
|
title: $:/core/modules/parsers/htmlparser.js
|
||||||
|
type: application/javascript
|
||||||
|
module-type: parser
|
||||||
|
|
||||||
|
The HTML parser displays text as raw HTML
|
||||||
|
|
||||||
|
\*/
|
||||||
|
(function(){
|
||||||
|
|
||||||
|
/*jslint node: true, browser: true */
|
||||||
|
/*global $tw: false */
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
var HtmlParser = function(type,text,options) {
|
||||||
|
this.tree = [{
|
||||||
|
type: "raw",
|
||||||
|
html: text
|
||||||
|
}];
|
||||||
|
};
|
||||||
|
|
||||||
|
exports["text/html"] = HtmlParser;
|
||||||
|
|
||||||
|
})();
|
||||||
|
|
@ -24,7 +24,6 @@ var TextParser = function(type,text,options) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
exports["text/plain"] = TextParser;
|
exports["text/plain"] = TextParser;
|
||||||
exports["text/html"] = TextParser;
|
|
||||||
exports["application/vnd.tiddlywiki2"] = TextParser;
|
exports["application/vnd.tiddlywiki2"] = TextParser;
|
||||||
exports["application/javascript"] = TextParser;
|
exports["application/javascript"] = TextParser;
|
||||||
exports["application/json"] = TextParser;
|
exports["application/json"] = TextParser;
|
||||||
|
Loading…
Reference in New Issue
Block a user