mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2026-08-29 14:18:55 +00:00
Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
26fe15670c | ||
|
|
f825255bb8 | ||
|
|
ee42f2f731 |
@@ -11,17 +11,16 @@ The image parser parses an image into an embeddable HTML element
|
|||||||
|
|
||||||
var ImageParser = function(type,text,options) {
|
var ImageParser = function(type,text,options) {
|
||||||
var element = {
|
var element = {
|
||||||
type: "element",
|
type: "image",
|
||||||
tag: "img",
|
attributes: {}
|
||||||
attributes: {}
|
};
|
||||||
};
|
|
||||||
if(options._canonical_uri) {
|
if(options._canonical_uri) {
|
||||||
element.attributes.src = {type: "string", value: options._canonical_uri};
|
element.attributes.source = {type: "string", value: options._canonical_uri};
|
||||||
} else if(text) {
|
} else if(text) {
|
||||||
if(type === "image/svg+xml" || type === ".svg") {
|
if(type === "image/svg+xml" || type === ".svg") {
|
||||||
element.attributes.src = {type: "string", value: "data:image/svg+xml," + encodeURIComponent(text)};
|
element.attributes.source = {type: "string", value: "data:image/svg+xml," + encodeURIComponent(text)};
|
||||||
} else {
|
} else {
|
||||||
element.attributes.src = {type: "string", value: "data:" + type + ";base64," + text};
|
element.attributes.source = {type: "string", value: "data:" + type + ";base64," + text};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.tree = [element];
|
this.tree = [element];
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
title: $:/changenotes/5.4.0/#9570
|
||||||
|
description: Fix images loaded from _canonical_uri tiddlers not having progress classes assigned
|
||||||
|
release: 5.4.0
|
||||||
|
tags: $:/tags/ChangeNote
|
||||||
|
change-type: bugfix
|
||||||
|
change-category: internal
|
||||||
|
github-links: https://github.com/TiddlyWiki/TiddlyWiki5/pull/9570
|
||||||
|
github-contributors: jermolene
|
||||||
|
|
||||||
|
Fixes issue whereby transcluding a _canonical_uri tiddler with a missing image did not assign the progress classes `tc-image-loading`, `tc-image-loaded` and `tc-image-error`.
|
||||||
Reference in New Issue
Block a user