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

search for parts of HTML entities corrupt list #13

Open
kilroy42 opened this issue Mar 21, 2019 · 1 comment
Open

search for parts of HTML entities corrupt list #13

kilroy42 opened this issue Mar 21, 2019 · 1 comment

Comments

@kilroy42
Copy link

kilroy42 commented Mar 21, 2019

See example: Use "Day" and search for "a":

What happens:

05 & asda (with all three a's underlined)

What was expected:
05 & asda (with both a's underlined)

And it gets worse with every search (delete "a", insert new "a" -> 05 & asda)

@linxf
Copy link

linxf commented Feb 23, 2020

Fixed the problem by replacing the below code in _filter

$this
    .html(function(index, oldhtml){
        return oldhtml.replace(new RegExp(pattern, 'gi'), '<span class="'+self.settings.markerClass+'">$1</span>')
    })

with

$this
    .html($this.text().replace(new RegExp(pattern, 'gi'), '<span class="'+self.settings.markerClass+'">$1</span>')
)

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

2 participants