Closed Chris-Gillis closed 6 years ago
I think you have some good points @bvaughn. I hadn't considered reusing the existing prop.
If you are interested in the change, I can make these changes to make it more palatable for you.
Regarding testing, I agree that it needs some new tests for this. Again if you want the change I can work on tests as well.
Thank you for reviewing my PR :)
No problem 😄 Thanks for the contribution and for being open to feedback.
If you make the suggested changes, and write a test or two, I'll accept the request!
I made the changes you suggested @bvaughn. I could only think of one test case, but I'm certainly open to writing more tests if you have other cases you would like me to test for.
I will edit the readme and push a new commit in a little bit.
Released as 0.12 !
This change introduces a new
prop
calledtextColors
. This new prop is a mapping of words to css classes and is used to apply these classes to the words.For example:
{ the: 'green', of: 'blue', hello: 'orange' }
In the example, instances of
the
will have the classgreen
applied to them instead ofhighlightClassName
.Note: I had trouble running the tests due to an
npm install
problem, probably withphantomjs
. I'm happy to take some advice on that to make sure that the tests still pass, because I was unable to do that.