Fix for identifying SVG images by file extension

print-window-tiddler
Jeremy Ruston 2012-03-03 13:39:35 +00:00
rodzic 9b8795856b
commit 505c332123
2 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

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

Wyświetl plik

@ -26,7 +26,7 @@ $$$
This renders as:
$$$image/svg+xml
$$$.svg
<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" />
</svg>