mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-05-03 07:54:10 +00:00

* remove blks first try * dprint.json seems to be OK, some forgotten functions * add some more space-after-keyword settings * server remove blks * add **/files to dprint exclude * dprint.js fixes a typo * add boot.js and bootprefix.js to dprint exclude * dprint change dprint.json * add dprint fmt as script * remove jslint comments * fix whitespace * fix whitespace * remove function-wrapper from geospatial plugin * fix whitespace * add function wrapper to dyannotate-startup * remove dpring.json
34 lines
779 B
JavaScript
34 lines
779 B
JavaScript
/*\
|
|
title: $:/core/modules/parsers/htmlparser.js
|
|
type: application/javascript
|
|
module-type: parser
|
|
|
|
The HTML parser displays text as raw HTML
|
|
|
|
\*/
|
|
|
|
"use strict";
|
|
|
|
var HtmlParser = function(type,text,options) {
|
|
var src;
|
|
if(options._canonical_uri) {
|
|
src = options._canonical_uri;
|
|
} else if(text) {
|
|
src = "data:text/html;charset=utf-8," + encodeURIComponent(text);
|
|
}
|
|
this.tree = [{
|
|
type: "element",
|
|
tag: "iframe",
|
|
attributes: {
|
|
src: {type: "string", value: src}
|
|
}
|
|
}];
|
|
if($tw.wiki.getTiddlerText("$:/config/HtmlParser/DisableSandbox","no") !== "yes") {
|
|
this.tree[0].attributes.sandbox = {type: "string", value: $tw.wiki.getTiddlerText("$:/config/HtmlParser/SandboxTokens","")};
|
|
}
|
|
this.source = text;
|
|
this.type = type;
|
|
};
|
|
|
|
exports["text/html"] = HtmlParser;
|