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

NSAttributedString extension highlight function bug. #13

Open
mgorvat opened this issue May 12, 2021 · 0 comments
Open

NSAttributedString extension highlight function bug. #13

mgorvat opened this issue May 12, 2021 · 0 comments

Comments

@mgorvat
Copy link

mgorvat commented May 12, 2021

There is a bug in the highlight function. It occurs when more than one range is in the input.
Line 22: highlightString.append(self.containAttribute(originText: originText, bound: ranges[i], attributes: highlightAttributes))

It takes wrong occurrence. Next, instead of needed one.
For example if originText = "String string String" and searchText = "string", then result will be (omitting attributes) "string String String". In fact you can clearly see this bug in the introduction gif (https://raw.githubusercontent.com/younatics/Highlighter/master/Images/Highlighter.gif)

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