Skip to content

removed useless regex characters escape#721

Open
exeba wants to merge 2 commits into
javve:masterfrom
exeba:regex-escape-fix
Open

removed useless regex characters escape#721
exeba wants to merge 2 commits into
javve:masterfrom
exeba:regex-escape-fix

Conversation

@exeba
Copy link
Copy Markdown

@exeba exeba commented Feb 24, 2021

Fixes #699

krisu5 added a commit to aegis-icons/aegis-icons.github.io that referenced this pull request Jan 28, 2022
jamesadney added a commit to hfa3/list.js that referenced this pull request Feb 7, 2022
The search code used to use 'string'.search which takes regex
input. Now it used indexOf, so escaping is unnecessary and
causes search to break after on of the special characters is
entered.

From: javve#721
@larseggert
Copy link
Copy Markdown

Would like to +1 this PR. Fixing search is important to our use of list.js.

@NevGibson
Copy link
Copy Markdown

I would also like to +1 this request. Seems a shame to leave an important feature broken if the work has already been done to fix it.

@kseitz10
Copy link
Copy Markdown

kseitz10 commented Jul 1, 2022

Another +1. Wanted to use this library, but immediately encountered this problem. This has been neglected for over a year, so... I guess this project is dead?

@jonnydh
Copy link
Copy Markdown

jonnydh commented Aug 11, 2022

+1 for this request

jonnydh added a commit to hmrc/catalogue-frontend that referenced this pull request Aug 11, 2022
This bug was introduced in List.js:2.3.0, and a fix has been proposed
which has not yet been merged: javve/list.js#721

This commit uses the proposed fix above.
jonnydh added a commit to hmrc/catalogue-frontend that referenced this pull request Aug 11, 2022
This bug was introduced in List.js:2.3.0, and a fix has been proposed
which has not yet been merged: javve/list.js#721

This commit uses the proposed fix above.
jonnydh added a commit to hmrc/catalogue-frontend that referenced this pull request Aug 11, 2022
This bug was introduced in List.js:2.3.0, and a fix has been proposed
which has not yet been merged: javve/list.js#721

This commit uses the proposed fix above.
jonnydh added a commit to hmrc/catalogue-frontend that referenced this pull request Aug 11, 2022
This bug was introduced in List.js:2.3.0, and a fix has been proposed
which has not yet been merged: javve/list.js#721

This commit uses the proposed fix above.
jonnydh added a commit to hmrc/catalogue-frontend that referenced this pull request Aug 11, 2022
This bug was introduced in List.js:2.3.0, and a fix has been proposed
which has not yet been merged: javve/list.js#721

This commit uses the proposed fix above.

Futher detail:
Prior to v2.3.0, the search used regexp, so special chars had to be escaped.
However version 2.3.0 implemented a new, faster search which didn't use regexp.
Therefore by continuing to escape special chars, it's not possible to search for them.
This defunct 'replace' function should be removed
jonnydh added a commit to hmrc/catalogue-frontend that referenced this pull request Aug 12, 2022
This bug was introduced in List.js:2.3.0, and a fix has been proposed
which has not yet been merged: javve/list.js#721

This commit uses the proposed fix above.

Futher detail:
Prior to v2.3.0, the search used regexp, so special chars had to be escaped.
However version 2.3.0 implemented a new, faster search which didn't use regexp.
Therefore by continuing to escape special chars, it's not possible to search for them.
This defunct 'replace' function should be removed
jonnydh added a commit to hmrc/catalogue-frontend that referenced this pull request Aug 12, 2022
This bug was introduced in List.js:2.3.0, and a fix has been proposed
which has not yet been merged: javve/list.js#721

This commit uses the proposed fix above.

Futher detail:
Prior to v2.3.0, the search used regexp, so special chars had to be escaped.
However version 2.3.0 implemented a new, faster search which didn't use regexp.
Therefore by continuing to escape special chars, it's not possible to search for them.
This defunct 'replace' function should be removed
@shivraj-hiremath
Copy link
Copy Markdown

+1 for the request. The project looks dead to me? Then better to find an alternative.

@lovasoa
Copy link
Copy Markdown

lovasoa commented Aug 2, 2023

@javve : any chance this can be merged, or the author can be added as a contributor ?

That would fix a bug in SQLPage (and many other dependent projects, I guess)

@lovasoa
Copy link
Copy Markdown

lovasoa commented Aug 3, 2023

If anyone needs to depend on a package on npm with the fix, I published: https://www.npmjs.com/package/list.js-fixed

@wayheming
Copy link
Copy Markdown

+1 Same issue there.

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.54%. Comparing base (d32c85d) to head (999ef60).
⚠️ Report is 5 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #721      +/-   ##
==========================================
- Coverage   93.54%   93.54%   -0.01%     
==========================================
  Files          19       19              
  Lines         837      836       -1     
  Branches      199      199              
==========================================
- Hits          783      782       -1     
  Misses         38       38              
  Partials       16       16              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Search on regexp characters broken by v2.3.0

8 participants