1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-02-17 11:30:02 +00:00

Fix for identifying SVG images by file extension

This commit is contained in:
Jeremy Ruston 2012-03-03 13:39:35 +00:00
parent 9b8795856b
commit 505c332123
2 changed files with 2 additions and 2 deletions

View File

@ -20,7 +20,7 @@ var ImageParser = function(options) {
ImageParser.prototype.parse = function(type,text) { ImageParser.prototype.parse = function(type,text) {
var src; var src;
if(type === "image/svg+xml") { if(type === "image/svg+xml" || type === ".svg") {
src = "data:" + type + "," + encodeURIComponent(text); src = "data:" + type + "," + encodeURIComponent(text);
} else { } else {
src = "data:" + type + ";base64," + text; src = "data:" + type + ";base64," + text;

View File

@ -26,7 +26,7 @@ $$$
This renders as: This renders as:
$$$image/svg+xml $$$.svg
<svg xmlns="http://www.w3.org/2000/svg" width="150" height="100"> <svg xmlns="http://www.w3.org/2000/svg" width="150" height="100">
<circle cx="100" cy="50" r="40" stroke="black" stroke-width="2" fill="red" /> <circle cx="100" cy="50" r="40" stroke="black" stroke-width="2" fill="red" />
</svg> </svg>