mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2026-09-17 23:31:22 +00:00
First pass at external image support
A bunch of little changes that together enable external image support. Try: ``` tiddlywiki editions/tw5.com --verbose --build externalimages ``` Then open `externalimages.html`, look for the images in the more/types tab of the sidebar, open them and verify that they are set with an external SRC attribute, not a data URI.
This commit is contained in:
@@ -19,7 +19,12 @@ var ImageParser = function(type,text,options) {
|
||||
attributes: {}
|
||||
},
|
||||
src;
|
||||
if(text) {
|
||||
if(options._canonical_uri) {
|
||||
element.attributes.src = {type: "string", value: options._canonical_uri};
|
||||
if(type === "application/pdf" || type === ".pdf") {
|
||||
element.tag = "embed";
|
||||
}
|
||||
} else if(text) {
|
||||
if(type === "application/pdf" || type === ".pdf") {
|
||||
element.attributes.src = {type: "string", value: "data:application/pdf;base64," + text};
|
||||
element.tag = "embed";
|
||||
|
||||
Reference in New Issue
Block a user