kopia lustrzana https://github.com/miklobit/TiddlyWiki5
Local relative urls in Markdown map to WikiLinks
rodzic
c0c0b6653c
commit
e5cef9a5a6
|
@ -48,6 +48,18 @@ function transformNode(node) {
|
||||||
delete widget.attributes.src;
|
delete widget.attributes.src;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Convert internal links to proper wikilinks
|
||||||
|
if (widget.tag === "a" && widget.attributes.href.value[0] === "#") {
|
||||||
|
widget.type = "link";
|
||||||
|
widget.attributes.to = widget.attributes.href;
|
||||||
|
if (widget.attributes.to.type === "string") {
|
||||||
|
//Remove '#' before conversion to wikilink
|
||||||
|
widget.attributes.to.value = widget.attributes.to.value.substr(1);
|
||||||
|
}
|
||||||
|
//Children is fine
|
||||||
|
delete widget.tag;
|
||||||
|
delete widget.attributes.href;
|
||||||
|
}
|
||||||
return widget;
|
return widget;
|
||||||
} else {
|
} else {
|
||||||
return {type: "text", text: node};
|
return {type: "text", text: node};
|
||||||
|
|
Ładowanie…
Reference in New Issue