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

Mark several occurrences of one word/expression #41

Closed
AlphaHasi opened this issue Jan 24, 2019 · 6 comments
Closed

Mark several occurrences of one word/expression #41

AlphaHasi opened this issue Jan 24, 2019 · 6 comments
Labels
enhancement New feature or request wontdo This will not be worked on

Comments

@AlphaHasi
Copy link

It would be nice to have the option to search for a term and then mark all occurrences. Especially for lists this could be helpful.

Workflow might be: select a word and then instead of „mark“ have a second option „mark all“.

(I know it is possible to highlight a sidewide search (strg+f) in the browser by default, but only for one search term at a time and only one default color.)

@ufb
Copy link
Owner

ufb commented Jan 25, 2019

Hi AlphaHasi,
the next 2 weeks I'm very busy, but next month there will be a major update and I will check if the requested feature is something that can be included.

@ufb
Copy link
Owner

ufb commented Feb 8, 2019

Just did some research on how this feature could be realised. Unfortunately it's non-trivial:
The easiest way would be to use window.find recursively, since this will select the searched text, which would make it very easy to wrap it with a highlight element - but this method is non-standard and should not be used.
Extensions can also use the browser's find API, but this doesn't select the text (the highlightings on a search are actually not wrapping elements and therefore of no use) - which means Textmarker would have to iterate over all text nodes and this is where it gets complicated...
So, all-in-all, it's definately not a feature that I can add before releasing 4.0.0. I will dig deeper though in order to find a good solution, but can't promise anything for the near future.

@AlphaHasi
Copy link
Author

Thanks for the research! I have no idea about the browser's native APIs (as a developer I only worked for content "inside" the browser) and assumed it would be an easy thing to add.

There was a popular add on "SearchWP", that was old type and had not a real replacement after the support was canceled. It is deleted from the servers now (and it is not the one plugin you find for WP on the internet). But I found another add on (now updated to new code) that can provide the functionality. Unfortunately it is not very stable (at least on my system) and does often not work at all, for example on WordPress pages, that have an user frame around the content (this typical grey border with your user name on top of each page after login). That was never an issue for the SearchWP add on. https://addons.mozilla.org/de/firefox/addon/highlightall/

If this would be complex to add and the result would be just unstable code, don't do it. Also the lack of others joining the topic might indicate the insignificance of this feature.

@ufb
Copy link
Owner

ufb commented Feb 8, 2019

I had a look at the source code of the cited addon just now - it is using the browser's find API for temporary hilighting and a nodeIterator otherwise - the developer is acknowledging lots of edge cases, iframes etc.
It's definately makeable, but devil is in the details. If it was just for hilighting without saving your highlights to Textmarker's history then this should be straight-forward. But there are some issues to overcome when saving (i.e. iframes will be problematic).

@AlphaHasi
Copy link
Author

ignore it -> close the topic -> 0 issues!

:)
thanks!

@ufb
Copy link
Owner

ufb commented Feb 8, 2019

:D I'll keep it open for now. There are a lot of things on the todo list but maybe I find the time some day to give it a go;)

@ufb ufb added the enhancement New feature or request label Feb 20, 2019
@ufb ufb closed this as completed Feb 21, 2019
@ufb ufb added the wontdo This will not be worked on label Feb 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request wontdo This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants