desconexo / highlight_text

A flutter plugin to highlight words from a text
MIT License
30 stars 22 forks source link

Support `|` character and numbers #46

Closed crizant closed 1 year ago

crizant commented 1 year ago

Currently if the user input contains two | characters around a number, the output may be incorrect. i.e.: the | characters will be removed and the numbers may be replaced by highlight words. I have a plan of solving this issue in two steps:

  1. Refactor the _buildSpan() method to remove the recursion.
  2. Make the _bind() method returns a List of String and int values, then we can tell if it's an int, it is a word that should be highlighted.
crizant commented 1 year ago

The first step is already in here: https://github.com/desconexo/highlight_text/pull/45

crizant commented 1 year ago

I did both steps but the project structure has been modified greatly, would you mind if I publish it as a new package?

desconexo commented 1 year ago

You are free to do it, as the package is open source and the license allows it.

I would rather to add you as a member to my pub.dev publisher, but yes, you can publish it as a new package.

crizant commented 1 year ago

Thanks. I still prefer you take a look first: #48 I'm using it in my production app, and I have added test cases. Feel free to publish a new version when you are ready.

desconexo commented 1 year ago

Thank you. New version published.