hnakamur / FormatLink-Firefox

A Firefox web-extension to copy the URL and the title or the selected text to clipboard
https://addons.mozilla.org/ja/firefox/addon/format-link3/
MIT License
45 stars 8 forks source link

ignore 'text' variable when no text is selected #48

Closed atomGit closed 2 years ago

atomGit commented 2 years ago

i thought the default behavior was to ignore the text variable when no text is selected, however this is not working

page title: something pattern: {{title}}{{text}}

produces 'somethingsomething'

hnakamur commented 2 years ago

Sorry, the document was wrong. I just fixed it at https://github.com/hnakamur/FormatLink-Firefox/commit/c5cba5d932db43dbf719858fcbbfd78437afd641.

atomGit commented 2 years ago

thank you, but i was hoping for a different approach - i think it it would be better, and more intuitive for users, if the text variable were simply ignored if there was no text highlighted

hnakamur commented 2 years ago

I need text variable as is. How about adding selected_text variable?

atomGit commented 2 years ago

sure - that would work

i don't understand though; the selected_text var would work exactly the same as text, no? so i'm wondering why you'd need a new variable

hnakamur commented 2 years ago

text variable value is not the same as selected_text since page title value is used if no text is selected.

text variable value is:

atomGit commented 2 years ago

ah, i see

by the way, THANKS for continuing to work on this - it's a very useful extension!

hnakamur commented 2 years ago

Thanks for kind words. I will merge Add selected_text variable (fixes #48) by hnakamur · Pull Request #53 · hnakamur/FormatLink-Firefox now.

hnakamur commented 2 years ago

I submitted version 5.3.0 to https://addons.mozilla.org/ja/firefox/addon/format-link3/