Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: SyntaxError: Invalid regular expression: /\b(\)/gi: Unterminated group (at result.js:39:16) #3968

Open
1 task done
burhandodhy opened this issue Aug 21, 2024 · 0 comments
Labels
bug Something isn't working
Milestone

Comments

@burhandodhy
Copy link
Contributor

Describe the bug

The Instant Results throws a syntax error if the search term includes a trailing backslash

react-dom.min.js?ver=18.3.1:2 SyntaxError: Invalid regular expression: /\b(test \)/gi: Unterminated group (at result.js:39:16)
    at new RegExp (<anonymous>)
    at __webpack_modules__../assets/js/instant-results/components/results/result.js.__webpack_exports__.default (result.js:39:16)
    at hu (react-dom.min.js?ver=18.3.1:2:60308)
    at xi (react-dom.min.js?ver=18.3.1:2:119597)
    at bs (react-dom.min.js?ver=18.3.1:2:108749)
    at vs (react-dom.min.js?ver=18.3.1:2:108677)
    at gs (react-dom.min.js?ver=18.3.1:2:108540)
    at as (react-dom.min.js?ver=18.3.1:2:105347)
    at ls (react-dom.min.js?ver=18.3.1:2:103902)
    at S (react-dom.min.js?ver=18.3.1:2:130522)

Steps to Reproduce

  1. Enabled Instant Results.
  2. Search for "test "
  3. See the browser's console

Screenshots, screen recording, code snippet

No response

Environment information

No response

WordPress and ElasticPress information

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@burhandodhy burhandodhy added the bug Something isn't working label Aug 21, 2024
@burhandodhy burhandodhy added this to the 5.2.0 milestone Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant