Closed RyotaUshio closed 12 months ago
Also reproduced in the sandbox vault, with only Banners 2.0.0-beta and BRAT installed
SYSTEM INFO:
Obsidian version: v1.4.13
Installer version: v1.4.13
Operating system: Darwin Kernel Version 22.3.0: Thu Jan 5 20:53:49 PST 2023; root:xnu-8792.81.2~2/RELEASE_X86_64 22.3.0
Login status: not logged in
Insider build toggle: off
Live preview: on
Legacy editor: off
Base theme: dark
Community theme: none
Snippets enabled: 0
Restricted mode: off
Plugins installed: 2
Plugins enabled: 2
1: Obsidian42 - BRAT v0.7.0
2: Banners v2.0.0-beta
RECOMMENDATIONS:
Community plugins: for bugs, please first try updating all your plugins to latest. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community plugins.
URLs are supposed to be working here, but I think this is a bad link; reason being how GitHub handles images.
Media files (or at least image files) with github.com
domains give a 404 (the image you mentioned is that: https://github.com/RyotaUshio/obsidian-math-booster/master/docs/fig/screenshot.png), but those with raw.githubusercontent.com
work properly (same image: https://raw.githubusercontent.com/RyotaUshio/obsidian-math-booster/master/docs/fig/screenshot.png). I noticed that the image you pasted is using the former
Thank you, it worked perfectly!
It's just out of curiosity, but I still don't understand why the former type of link does work in v.1.3.3 (only in reading view).
https://github.com/noatpad/obsidian-banners/assets/72342591/42a053f5-7bde-4ff1-8e5c-bae6281434d5
Media files (or at least image files) with github.com domains give a 404 (the image you mentioned is that: https://github.com/RyotaUshio/obsidian-math-booster/master/docs/fig/screenshot.png),
I noticed you missed raw
before master
, I mean it's https://github.com/RyotaUshio/obsidian-math-booster/raw/master/docs/fig/screenshot.png, not https://github.com/RyotaUshio/obsidian-math-booster/master/docs/fig/screenshot.png.
It gives 404 without raw
, but it doesn't with it.
Oh hm, that is a bit peculiar. I'm not sure how exactly how it works, but perhaps the raw
part of the path acts as a redirect to the raw.githubusercontent.com
URL. Obsidian also seems to throw some CORS errors with that link too, which I may be able to fix. But I'm not sure why it may work in one view and not the other
I'm not sure why it may work in one view and not the other
Do you mean v.1.3.3 can handle it in reading view but can't in live preview? If so, I'm sorry, it turned out it works if I set the "Properties in document" setting to "Source". (And the same happens for local images too.)
https://github.com/noatpad/obsidian-banners/assets/72342591/cfff3fe1-741b-485b-9b3f-8b8326eeb190
But exactly the same YAML doesn't work in v.2.0.0-beta.
https://github.com/noatpad/obsidian-banners/assets/72342591/c45c67f4-cd91-4530-83f2-e5106908425e
OH, I missed that from before, I thought we were still talking about the v2-beta.
But yes, in 1.3.3, the banner actually does show with setting Properties in document
to Source
on the editing view, so that is what's supposed to happen.
As for v2's behavior, it looks like it is possibly CORS, which there is an Obsidian API function to use to avoid that issue, though I'd need to see if I can use it because of how I'm fetching the image
As you suggested, I simply replaced fetch()
with requestUrl()
, and then it worked! Please refer to the PR. (Or is it too naive?)
That does the trick actually! Will put this in the next beta release soon-ish, thank ya kindly
Hi, thank you for making this awesome plugin alive again.
I tried v2.0.0-beta, and I copied a URL https://github.com/RyotaUshio/obsidian-math-booster/raw/master/docs/fig/screenshot.png and ran the command
Paste banner from clipboard
. But it gave me an error "Couldn't load the banner! Is thebanner
field correct?"https://github.com/noatpad/obsidian-banners/assets/72342591/40e95fc2-579b-43c5-93f0-7e1791cc00dc
Am I doing something dumb or is it a bug? Or is URL not supported yet in v2?