Skip to content

NSAttributedString extension highlight function bug. #13

@mgorvat

Description

@mgorvat

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions