More fixes related to #363
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import {
|
||||
cleanPageRef,
|
||||
federatedPathToUrl,
|
||||
resolveAttachmentPath,
|
||||
resolvePath,
|
||||
rewritePageRefs,
|
||||
} from "$sb/lib/resolve.ts";
|
||||
@@ -90,4 +91,22 @@ This is a [[!silverbullet.md/local link]] and [[!silverbullet.md/local link|with
|
||||
rewrittenText,
|
||||
`This is a [[local link]] and [[local link|with alias]].`,
|
||||
);
|
||||
|
||||
assertEquals("test.jpg", resolveAttachmentPath("test", "test.jpg"));
|
||||
assertEquals(
|
||||
"folder/test.jpg",
|
||||
resolveAttachmentPath("folder/test", "test.jpg"),
|
||||
);
|
||||
assertEquals(
|
||||
"test.jpg",
|
||||
resolveAttachmentPath("folder/test", "/test.jpg"),
|
||||
);
|
||||
assertEquals(
|
||||
"https://silverbullet.md/something/test.jpg",
|
||||
resolveAttachmentPath("!silverbullet.md/something/bla", "test.jpg"),
|
||||
);
|
||||
assertEquals(
|
||||
"https://silverbullet.md/test.jpg",
|
||||
resolveAttachmentPath("!silverbullet.md/something/bla", "/test.jpg"),
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user