Merge pull request #299 from carbeer/master

make note links in md compatible with obsidian
This commit is contained in:
windingwind 2022-12-26 11:23:39 +08:00 committed by GitHub
commit 0122e0970d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -864,6 +864,7 @@ class SyncUtils extends AddonBase {
newChild.properties.zhref = node.properties.href;
newChild.properties.href = link;
newChild.properties.ztype = "znotelink";
newChild.properties.class = "internal-link"; // required for obsidian compatibility
const newNode = h("znotelink", [newChild]);
this.replace(node, newNode);
console.log("direct link", node, newNode, newChild);
@ -1072,6 +1073,7 @@ class SyncUtils extends AddonBase {
}
for (const node of nodes) {
node.properties.href = node.properties.zhref;
delete node.properties.class;
delete node.properties.zhref;
delete node.properties.ztype;
}