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

Matches gone after replacement #75

Open
chiluap opened this issue Jan 31, 2018 · 0 comments
Open

Matches gone after replacement #75

chiluap opened this issue Jan 31, 2018 · 0 comments

Comments

@chiluap
Copy link

chiluap commented Jan 31, 2018

Hi James,
I was wondering, is it possible to see what strings in the DOM matched the find: RegExp?
I am using the following options and would like to know which strings where matched.

var searchConfig = {
            find: new RegExp(pool.searchText, 'g'),
            wrap: wType || 'span',
            wrapClass: wClass || 'filter-number',
 };
var finder = findAndReplaceDOMText(domElement, searchConfig);

Since the matches are popped finder.matches is empty after execution.
Is there a way to seperate find and wrap function calls to extract the matches in beween?

If not I could implement some 'persistentMatches: true' flag that would write the matches into this.persistentMatches or so?

Keep up the awsome work.

Thank you

Christian

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

No branches or pull requests

1 participant