-
-
Notifications
You must be signed in to change notification settings - Fork 202
New 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
Problem of compatibility with the new URI of obsidian 1.7.3 and obsidian web clipper #1465
Comments
I am not able to reproduce this on Obsidian 1.7.3 and Templater 2.7.2. Here is the root folder template I'm testing with. It is the only folder template I have in this vault.
Can you provide more details about your setup, such as if you have other folder templates, and the contents of the root folder template? Templater already has a delay of 300ms, to account for core plugins such as Note Composer and community plugins such as Note Extractor. When I've adjusted this delay in the past, I've gotten bug reports saying that it broke other community plugins, so I would like to avoid adjusting that delay. |
Do you have a specific URL I can test with? And the Clipper template? I've tried dozens of times and haven't been able to reproduce. |
For example, I just retested, and it was reproduced with this page: https://resources.arc.net/hc/en-us/articles/22513842649623-Arc-for-Windows-2023-2024-Release-Notes and this clipper template : I still can't understand why the bug doesn't appear every time, but only at certain times. |
Tried with that site and template a dozen time, no dice. Maybe it's a Windows only bug, or some combination of plugins is causing the bug. I don't have a Windows 11 device to test with. Regardless, I'll keep this open for a while to see if any devs can reproduce and have ideas for solutions around this. |
I have the same issue on Windows 10... After the note is created, pressing CTRL-Z (undo) recovers the clipped text. It happens almost 100% of the time (just so that I don't say 100% of the time). NOTE / EDIT: I'm on Obsidian 1.7.4. |
What did you do to fix this? |
I used an external software (power toys) to create a shortcut that open an advanced uri url, to create a file and apply the global template, and I remapped this shortcut to Ctrl Shift N. I realize however that he seemed to not really work lately. Moreover, it's still complex for what it bringsI realize however that he seemed to not really work lately. Moreover, it's still complex for what it brings. But, I haven't tried again recently to put a global Template in templater and see if there is still the problem. To check if it can come from an interaction between plugins, which other plugins do you use? |
A quick way to tell if it's an interaction between plugins would be to create a new vault with just the Templater community plugin installed and enabled. |
So, I tested again and for the moment I can no longer reproduce the problem whether in a test vault or in my personal vault. |
With only Templater being enabled the same thing happens. I guess it is the order of the operations and the time Templater takes to process things. The new note is created with the contents already populated, but then the global template is triggered and apples the template which replaces all the contents of the note... This is why |
I think it is how the Templater plugin applies the template. This also started happening with notes shared on mobile directly to Obsidian. I don't clip things that much, so I can't say when it started. Sharing or clipping to existing files work without issues as it doesn't trigger Templater templates. |
I'll just add that I'm seeing this on all my primary Apple devices (MacBook Air, iPhone, and iPad) as well, so it's not just Windows. I don't yet have any additional data points to add, though I'm planning to test it with a new, barebones vault with only Templater installed. My global template is pretty basic, so it's not a critical concern at the moment. |
I saw the same problem as @tlockney and @jgodoy when using the Obsidian Web Clipper on iOS– a new note was created, but only the title was applied then I would have to manually paste into the body. However, this comment on Reddit pointed out that using a regex to tell Templater to ignore the "Clippings" directory allowed for the content to make its way into the note. Here's what I used in Templater settings on both iOS and Desktop in order to work around the issue: |
@tayiorbeii oh, nice! It somehow didn't occur to me that Templater was using regex, but now it seems obvious (and I'm guessing it's documented, but then I'd actually have to read the docs to find out🤣). |
I appreciate the regex solution, but Templater settings says specifically that one must use "folder templates" OR "file regex templates". I would not know how to move my template from "folder" to "regex" in order to make Obsidian's web clipper work (obviously I too am getting the error whereby the web clipper is ignored and my default template takes over, losing all of the web clipper content --- probably because my default template asks me to name the file and then the folder first causing a delay?) EDIT: |
@filmgal You can just paste the regex in that box where your slash is. |
Plugin information
Describe the bug
Obsidian version 1.7.3 introduced a modification to the URI system, which is used by the Obsidian Web Clipper extension.
The issue arises when there is a global template set in Templater's configuration, i.e., a folder template that applies to "/".
When creating a note via a URI, such as with the Obsidian Web Clipper, there is usually content added—either directly from the URI or appended from the clipboard by Obsidian.
I believe the content is not applied immediately, and there is a slight delay between the creation of the note and the insertion of the content. This causes a problem when using a global template with Templater because Templater tries to apply the global template to the empty note during this brief delay.
As a result, approximately 50% of the time, when creating a note via the URI, the expected content is missing, and only the global template is applied.
Expected behavior
I would like the global template to be applied only if no content is inserted by Obsidian. I'm unsure how this could be achieved—perhaps by introducing a slight delay before applying the global template.
The text was updated successfully, but these errors were encountered: