1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-10-01 00:10:45 +00:00

Changed the SVG parser to use IMG tags

Embed the SVG image in an IMG tag rather than directly, to ensure that
it has it's own DOM state (otherwise things like IDs in SVG images are
visible to the hosting page)
This commit is contained in:
Jeremy Ruston 2012-01-17 13:53:04 +00:00
parent bd17a389cb
commit 102724b3e8
2 changed files with 1 additions and 5 deletions

View File

@ -16,7 +16,7 @@ var SVGParseTree = function() {
SVGParseTree.prototype.compile = function(type) {
if(type === "text/html") {
return "(function (tiddler,store,utils) {return tiddler.text;})";
return "(function (tiddler,store,utils) {return '<img src=\"data:' + tiddler.type + ',' + encodeURIComponent(tiddler.text) + '\">';})";
} else {
return null;
}

View File

@ -94,7 +94,3 @@ a.tw-tiddlylink-resolves {
a.tw-tiddlylink-missing {
font-style: italic;
}
svg {
width: 100%;
}