nextapps-de / flexsearch

Next-Generation full text search library for Browser and Node.js
Apache License 2.0
12.53k stars 491 forks source link

Fix: Replaced Unicode Property Escapes for Compatibility with Older Chrome Versions #414

Closed James4Ever0 closed 10 months ago

James4Ever0 commented 10 months ago

This pull request addresses compatibility issues with older versions of Chrome (prior to Chrome 61) by replacing the Unicode property escapes in regular expressions with equivalent expressions using standard character classes.

The original Unicode property escape sequence [\p{Z}\p{S}\p{P}\p{C}] has been replaced with a compatible expression to ensure functionality across a wider range of Chrome versions.

This change resolves the "invalid regular expression flag" error encountered in Chrome 4x.xx and ensures consistent behavior across different browser versions.

ThiefMaster commented 10 months ago

Why would anyone care about a Chrome version from over six(!) years ago?!

James4Ever0 commented 10 months ago

I care because I use old version of Chrome to ensure visibility of my client-side search based document index.

ts-thomas commented 10 months ago

Thanks a lot. I've added it to my code as a comment. You can use your own encoder to apply such modification. I need to think about how to improve customizing encoders.