Skip to content
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

Add option for better paste IDs using invisible characters #125

Merged
merged 2 commits into from
Dec 4, 2024

Conversation

enesflow
Copy link

@enesflow enesflow commented Aug 14, 2024

Bildschirmfoto 2024-08-14 um 15 32 04

Add a new option called "Use Better Fetching Placeholder" that when activated will generate unique paste IDs by placing invisible characters in random places in the "Fetching Title" string so that it looks a bit nicer.

If activated, this new generation method might cause some problems with some spellchecks.

@zolrath
Copy link
Owner

zolrath commented Dec 4, 2024

Clever! I like it, thanks!

@zolrath zolrath merged commit 9d70f6f into zolrath:main Dec 4, 2024
@greetclammy
Copy link

May I ask why the plugin appends characters for uniqueness at all? Why make "Fetching title" unique? 🤔

@enesflow
Copy link
Author

May I ask why the plugin appends characters for uniqueness at all? Why make "Fetching title" unique? 🤔

I think the plugin searches the "Fetching title" and replaces it with the title and url in the file. So those random characters are necessary to not mess with user generated text and support multiple requests simultaneously.

@greetclammy
Copy link

Makes sense.

support multiple requests simultaneously

Hm, I can't get this to work. When the clipboard is:

https://www.example.net
https://www.example.com

and I run the Paste URL and auto fetch title command, the plugin simply pastes the URLs as in normal paste--no title fetching.

@enesflow
Copy link
Author

and I run the Paste URL and auto fetch title command, the plugin simply pastes the URLs as in normal paste--no title fetching.

I haven't explored the code that much but I assume this not working is because the plugin currently checks if the whole clipboard paste is a URL or not. But implementing the functionality "multi URL pastes" wouldn't be that difficult.

Also, by simultaneous requests, I meant pasting multiple URLs one at a time consecutively while the previous requests are ongoing.

@zolrath
Copy link
Owner

zolrath commented Dec 14, 2024

The plugin only supports fetching a clipboard with a single URL, it doesn't perform any splitting of a single clipboard with multiple URLs, though you can put your cursor over each URL and trigger gathering the title for each one independently.

The unique title is because the plugin replaces the "Fetching Title" link with the resulting title so the unique titles allow it to differentiate between in flight requests when multiple are running at the same time.

@greetclammy
Copy link

All cleared up. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants