Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(markdown): preserve Obsidian note navigation links #31386

Openkirel(GitHub profile, opens in a new tab)wants to merge 10 commits intomain fromrefs/pull/31386/headopened View on GitHub

Showing 11 changed files with 29 additions and 1 deletion (loading 8).

x
0 of 11 viewed, 11 left
18 additions and 0 deletionsapps/desktop/src/electron/ElectronShell.test.tsModified
View file
@@ -181,6 +181,24 @@
}).pipe(Effect.provide(ElectronShell.layer)),
​
+ it.effect("opens Obsidian note links but not Advanced URI writes", () =>
+ Effect.gen(function* () {
+ openExternalMock.mockResolvedValue(undefined);
+ const electronShell = yield* ElectronShell.ElectronShell;
+ assert.equal(
+ yield* electronShell.openExternal("obsidian://open?vault=Example&file=notes%2FExample.md"),
+ true,
+ );
+ assert.equal(
+ yield* electronShell.openExternal(
+ "obsidian://adv-uri?vault=Example&filepath=Example&data=overwrite&mode=overwrite",
+ ),
+ false,
+ );
+ assert.equal(openExternalMock.mock.calls.length, 1);
+ }).pipe(Effect.provide(ElectronShell.layer)),
+ );
+​
it.effect("does not open unsafe external URLs", () =>
Effect.gen(function* () {
const electronShell = yield* ElectronShell.ElectronShell;
3 additions and 1 deletionapps/desktop/src/electron/ElectronShell.tsModified
View file
@@ -11,6 +11,7 @@