1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2026-01-23 19:34:39 +00:00

Compare commits

...

3 Commits

Author SHA1 Message Date
Jeremy Ruston
26fe15670c Joyously fix eslint error
I don't think this was introduced by this PR
2026-01-10 14:46:39 +00:00
Jeremy Ruston
f825255bb8 Create changenote 2026-01-10 14:43:51 +00:00
Jeremy Ruston
ee42f2f731 Fix images loaded from _canonical_uri tiddlers do not have loading and error classes assigned 2026-01-10 14:27:36 +00:00
2 changed files with 16 additions and 7 deletions

View File

@@ -11,17 +11,16 @@ The image parser parses an image into an embeddable HTML element
var ImageParser = function(type,text,options) {
var element = {
type: "element",
tag: "img",
attributes: {}
};
type: "image",
attributes: {}
};
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) {
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 {
element.attributes.src = {type: "string", value: "data:" + type + ";base64," + text};
element.attributes.source = {type: "string", value: "data:" + type + ";base64," + text};
}
}
this.tree = [element];

View File

@@ -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`.