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

feature: global option for character replacements #49

Closed atomGit closed 2 years ago

atomGit commented 2 years ago

in many of the formatting options i add...

<variable>.s("“|”|„|″","\"").s("‘|’|′","'")}}

please consider adding a global option(s) to replace such characters with their plain equivalents

Yukisama/TextLinkyTool for example offers the following options...

Convert all type quotation to normal quotation. Convert all type apostrophe to normal apostrophe. Convert all type dash to normal dash. Convert fullwidth space to normal space. Delete context around space.(trim) Delete invisible space. Merge all type space to one space.

i think some of the above could be combined into 1 'format cleaning' option, perhaps all except the last one

hnakamur commented 2 years ago

How about adding global replacement options for each variable?

Add global replace options by hnakamur · Pull Request #50 · hnakamur/FormatLink-Firefox

image

atomGit commented 2 years ago

ah, yeah, perhaps that's even more useful - except i might suggest simplifying what you have in the screencap to just...

"searchRegEx","replaceRegEx"

...or dividing the text input into 2 parts (search, replace) and eliminate the quotes altogether

hnakamur commented 2 years ago

Actually I implemented with two parts: searchRegEx and replacement string before this version. However this version is better since it can deal with multiple replacements like: {{text.s("regexp1","replacement1").s("regexp2","replacement2")}}

atomGit commented 2 years ago

i see - makes sense!