mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-08-08 06:43:49 +00:00
Support the image widget in markdown
This commit is contained in:
parent
de07da3797
commit
45b0966013
@ -33,6 +33,18 @@ function transformNode(node) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
widget.children = transformNodes(node.slice(p++));
|
widget.children = transformNodes(node.slice(p++));
|
||||||
|
// Massage images into the image widget
|
||||||
|
if(widget.tag === "img") {
|
||||||
|
widget.tag = "$image";
|
||||||
|
if(widget.attributes.alt) {
|
||||||
|
widget.attributes.tooltip = widget.attributes.alt;
|
||||||
|
delete widget.attributes.alt;
|
||||||
|
}
|
||||||
|
if(widget.attributes.src) {
|
||||||
|
widget.attributes.source = widget.attributes.src;
|
||||||
|
delete widget.attributes.src;
|
||||||
|
}
|
||||||
|
}
|
||||||
return widget;
|
return widget;
|
||||||
} else {
|
} else {
|
||||||
return {type: "text", text: node};
|
return {type: "text", text: node};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user