fuzzy icon indicating copy to clipboard operation
fuzzy copied to clipboard

Add match structure object for safer HTML wrapping of strings

Open wolfd opened this issue 8 years ago • 1 comments

It may be a bit overkill, but returning an array of little objects containing whether each character is a match allows for easier parsing of the structure in other applications.

I have a use case where I need to transform the example <b> </b> tags into React components, which is possible by parsing through the string, finding matching tags, and replacing them with React components, but the original library is where this code should be.

The added single variable and if statement added to the main loop of the program will slightly degrade performance, but I believe the cost/benefit ratio is worth it for other people considering the fuzzy library.

wolfd avatar May 16 '16 20:05 wolfd

Thanks for the PR. Investigating this. The problem it solves is definitely worth solving, but not sure this is the best approach.

Created issue #26 to track this.

mattyork avatar Sep 25 '16 19:09 mattyork