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

When a space is added additionaly to the searchterm every space is marked #7

Open
tobika opened this issue Jan 9, 2018 · 3 comments

Comments

@tobika
Copy link

tobika commented Jan 9, 2018

Example on your demo:
https://arthurvaverko.github.io/ngx-highlight/

When you search for example "some " with a space behind all spaces are marked.
To see this you can just use: document.querySelectorAll('mark') in the webconsole.

Probably something with the regex? Unfortunately they are dark magic for me ;)

Use case for me: I want to highlight 2 or more words that are connected with a space in one string.

PS : thanks a lot for this otherwise great directive

@arthurvaverko-kaltura
Copy link
Collaborator

arthurvaverko-kaltura commented Jan 9, 2018 via email

@tobika
Copy link
Author

tobika commented Jan 9, 2018

Thanks for you fast response. The fact that they are selected independently could be ok for me. The question is if it's wanted that once you add a space to the search term all spaces are marked, this might be unwanted for most people?

I guess I will forbid my users to write a space in the search bar.

@arthurvaverko-kaltura
Copy link
Collaborator

arthurvaverko-kaltura commented Jan 10, 2018 via email

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

No branches or pull requests

2 participants