helior / react-highlighter

:high_brightness: Highlight text using React
MIT License
157 stars 42 forks source link

Add support to regular expressions using a global parameter. #61

Open bram-ontoforce opened 6 years ago

bram-ontoforce commented 6 years ago

This PR adds support to regular expressions using a global parameter e.g.

<Highlight search=/brown|jumps/g">The quick brown fox jumps over the lazy dog</Highlight>

will both highlight 'brown' and 'jumps'. This handles issue #60.

yeou commented 6 years ago

@helior Any news on this PR?

mihaiserban commented 5 years ago

can this branch be merged? support for multiple highlights using regex would be great to have.

mihaiblaga89 commented 5 years ago

I'm wondering why this PR adds request as a dependency.

bram-ontoforce commented 5 years ago

I'm wondering why this PR adds request as a dependency.

I added request to the devDependencies to make the tests run. I saw that another PR was opened proposing this change (https://github.com/helior/react-highlighter/pull/58) so I'll remove the package from this branch.

kevinmacek commented 5 years ago

This would be great to have.

danperrout commented 5 years ago

This would be great to have.

Indeed!

ahong1 commented 5 years ago

@helior please merge this in. This is a great addition!