gavvvr / obsidian-imgur-plugin Public
generated from obsidianmd/obsidian-sample-pluginNew issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make the plugin compatible with live preview (Obsidian v0.13.0 onwards) #20
Comments
|
Hi @riddyrayes. Thanks for early reporting! Did not know anything about live preview before you posted this. Quickly googled to get the idea. So, live preview is something similar to WYSIWYG. I have not tried any 0.13+, correct me if I am wrong, but I suggest that the problem with LivePreview is that the plugin simply does not work, as if it was disabled. I guess, there could be many other plugins affected. Please add links to the same issues of other projects (if you have them). I am interested in how it will be fixed. I guess the solution will be similar for all. Maybe there is already a common discussion of this problem, so please leave useful links here |
I will attach any important developments in this regard when I find them! Thanks for the quick response! |
|
Hi, any plans when this great plugin will be ready for "live preview"? I'm using Obsidian Release v0.13.8 (Insider build) which is working great but not with the imgur upload. |
|
Live preview is public now, but this very important plugin doesn't work with live preview. Hope it can be implemented soon! |
|
Confirmed, livepreview rolled out and imgur is n/a in any mode, pretty sad and lost tones of time trying to figure what's going on( |
|
I have no idea how to bring it back to life now. It's a really breaking change. The |
|
You may can use this to fix, but l do not known how to off this event. this.app.workspace.on(
"editor-paste",
(evt: ClipboardEvent, editor: Editor, markdownView: MarkdownView) => {
let files = evt.clipboardData.files;
if (
files.length !== 0 ||
files[0].type.startsWith("image")
) {
this.uploadFileAndEmbedImgurImage(editor).catch(console.error);
evt.preventDefault();
}
}
); |
|
Maybe this info from https://www.obsidianroundup.org/2021-12-25/ For Developers:Here's a handy guide for how to update your plugins and themes for Obsidian 0.13+. There's further documentation on how to use CM6 with Obsidian from Obsidian October winner @nothingislost. |
|
Thanks a lot @renmu123 . This is almost the solution.
As I understand the combination of both facts above leads to an immediate event propagation to default handler, so the image gets pasted locally even before a user provided his response from modal window. And I can not invoke So, at the moment I am stuck with this problem
|
You may can read yaml config instead of confirming every upload ,this may rearch the feature |
This would break the backwards compatibility for anyone who is used to reply to modal on each upload. I will not go this way. |
Currently the whole sense of plugin is broken, everyone notified of problem, so could be a red notice on plugin page. Idk if you have stats for how much ppl really use confirmations, doesn't seem to be sensitive feature at all |
|
Licat has helped me on Discord to solve my dilemma It turned out there are undocumented methods to process an event (or it's copy) once again:
The 2.1.1 version has just been released It is also bound to implementation details (which was also true for previous versions), so we can expect this plugin to break in the future. But looks like using undocumented API is the best option available to me now. Thanks to everybody who did any contribution to get this plugin fixed |
The plugin fails to work in Live preview.
This is not a urgent request. I would accept if you decide to work on this after Live preview goes public.
The text was updated successfully, but these errors were encountered: