Skip to content

Commit d30fd30

Browse files
added link to circuit-sketcher file in the notes
1 parent d91f605 commit d30fd30

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"id": "circuit-sketcher",
33
"name": "Circuit Sketcher",
4-
"version": "1.2.0",
4+
"version": "1.2.1",
55
"minAppVersion": "0.15.0",
66
"description": "Draw circuits on a canvas using circuit-sketcher-core.",
77
"author": "Code Forge Temple",

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "circuit-sketcher-obsidian-plugin",
3-
"version": "1.2.0",
3+
"version": "1.2.1",
44
"main": "main.js",
55
"author": "Code Forge Temple",
66
"license": "GPL",

src/main.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,19 @@ export default class CircuitSketcherPlugin extends UpgradablePlugin {
7777

7878
const pngPath = `${this.settings.cachePath}/${hashPath(fileName)}`;
7979
const img = document.createElement('img');
80+
const link = document.createElement('a');
8081

8182
img.src = this.app.vault.adapter.getResourcePath(pngPath);
8283
img.onerror = () => {
8384
img.style.display = "none";
8485
};
8586

86-
embed.parentElement?.replaceChild(img, embed);
87+
link.href = this.app.metadataCache.fileToLinktext(file, ctx.sourcePath, true);
88+
link.setAttribute('data-href', fileName);
89+
link.classList.add('internal-link');
90+
link.appendChild(img);
91+
92+
embed.parentElement?.replaceChild(link, embed);
8793
}
8894
});
8995
}

0 commit comments

Comments
 (0)