Skip to content

Commit

Permalink
Merge pull request #89 from 0xGG/fix/local-image-bug
Browse files Browse the repository at this point in the history
fix: Fixed rendering local image bug
  • Loading branch information
shd101wyy committed May 10, 2020
2 parents d5a5e8e + 4bc6b8e commit 06a50ee
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/utilities/image.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,11 @@ export async function loadImageAsBase64(
if (imageSrc.startsWith("/")) {
imageFilePath = path.resolve(note.notebook.dir, "." + imageSrc);
} else {
imageFilePath = path.resolve(note.notebook.dir, imageSrc);
imageFilePath = path.join(
note.notebook.dir,
path.dirname(note.filePath),
imageSrc,
);
}
if (await pfs.exists(imageFilePath)) {
const data: Uint8Array = new Uint8Array(
Expand Down

0 comments on commit 06a50ee

Please sign in to comment.