lumen-notes / lumen

A simple note-taking app for better thinking
https://uselumen.com
MIT License
403 stars 25 forks source link

Assets from github can't be fetched #378

Open zaaakher opened 1 month ago

zaaakher commented 1 month ago

In an attempt to work around #377 I went to github.com and edit my note.md file and uploaded a gif to it. And it looks and works fine on github 👇

image

But when I go to lumen to view that same note it seems the asset isn't being displayed because it keeps facing a network error when fetching them.

image

zaaakher commented 1 month ago

Ok my workaround here works after changing the link to the asset for an actual URL to a path to the asset in uploads folder

image

colebemis commented 1 month ago

Oh interesting. I wonder if the github.com image is protected (because I'm assuming your notes repo is private) and Lumen isn't attaching a token when requesting that asset.

zaaakher commented 1 month ago

@colebemis ah you're right, I think this issue is only with private repos.

We could perhaps add a condition if the image src has github.com in it. But I'm not sure how we can attach the github auth token to the image request.

https://github.com/lumen-notes/lumen/blob/060682747d46cd262f368ee23f6565f74681c387/src/components/markdown.tsx#L571-L587

colebemis commented 1 month ago

This would be a nice enhancement if it's an easy change but I'm not sure it's worth the effort if it's hard, since Lumen already supports direct image uploads on private repos.

navigator8 commented 2 weeks ago

Just learnt something. I dis not about image support in notes