bvaughn / react-highlight-words

React component to highlight words within a larger body of text
https://bvaughn.github.io/react-highlight-words/
MIT License
2.18k stars 171 forks source link

fix: set autoEscape to true on demo website #102

Closed dorobila closed 2 months ago

dorobila commented 1 year ago

The demo website was crashing when you typed [ into Search terms box.

Had a discussion with bvaughn about setting the autoEscape param to true on highlight-words-core package, but as he said, changing the default value is going to have performance implications for current users.

image image

sergei-startsev commented 1 year ago

@dorobila autoEscape is not enabled by default, so I'd rather provide an option to enable/disable it on the demo to avoid confusion.

dorobila commented 1 year ago

@sergei-startsev sure thing. I'll add the checkbox, but that is still going to break the app if it's unchecked on page load or unchecked and someone types [.

sergei-startsev commented 1 year ago

@dorobila I agree that this case should be handled out of the box, but changing the defaults can be considered a breaking change. There're some plans to refresh the library, so there will be an opportunity to change it in one of major releases.