mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-11-17 07:47:24 +00:00
Update HTML parser to use an IFRAME
Gives us better sandboxing of unsafe HTML content
This commit is contained in:
@@ -13,9 +13,18 @@ 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," + encodeURIComponent(text);
|
||||
}
|
||||
this.tree = [{
|
||||
type: "raw",
|
||||
html: text
|
||||
type: "element",
|
||||
tag: "iframe",
|
||||
attributes: {
|
||||
src: {type: "string", value: src}
|
||||
}
|
||||
}];
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user