Comments (4)
expected result is the same as with one space
from highlight-words.
Hi @Geksanit! Nice catch! I'm not sure though if it should be the expected result. I think prepping the query should be in the hands of the consumer, otherwise we might end up stripping things we're not supposed to from the query.
You raise a good question though...what should the expected result then be? I'm not sure, so I'll have a think.
from highlight-words.
Hi @tricinel Perhaps the query should be an array of string?
from highlight-words.
Definitely not! I don't see how that would help. I think I have it sorted though.
- If the query contains more than one space in the middle, we will strip it. So
over the
andover the
with more than 2 spaces in between all are equivalent to searching for(over|the)
. - If the consumer specifically wants the double space, they can pass
matchExactly: true
as before. We don't strip multiple spaces then. - If the consumer wants to highlight individual words and however many spaces, then they can pass a regexp directly in the query. Something like
/(\w+)|\s{2,}/
- which will highlight all words and at least two consecutive spaces.
I'm not sure if this is a breaking change. If anything, it was a bug before.
from highlight-words.
Related Issues (9)
- ESM Support HOT 14
- Regular expresion in query param? HOT 11
- Invalid query type HOT 2
- This work with IE browser? HOT 1
- Option to ignore diacritics HOT 1
- Option Proposal: `maxLength` HOT 9
- Investigate potential performance issues HOT 3
- New Option: `clipByLength` HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from highlight-words.