highlight-words-core
Advanced tools
Comparing version 1.2.2 to 1.2.3
@@ -144,5 +144,5 @@ module.exports = | ||
var prevChunk = processedChunks.pop(); | ||
if (nextChunk.start <= prevChunk.end) { | ||
if (nextChunk.start < prevChunk.end) { | ||
// It may be the case that prevChunk completely surrounds nextChunk, so take the | ||
// largest of the end indeces. | ||
// largest of the end indexes. | ||
var endIndex = Math.max(prevChunk.end, nextChunk.end); | ||
@@ -149,0 +149,0 @@ processedChunks.push({ highlight: false, start: prevChunk.start, end: endIndex }); |
{ | ||
"name": "highlight-words-core", | ||
"description": "Utility functions shared by react-highlight-words and react-native-highlight-words", | ||
"version": "1.2.2", | ||
"version": "1.2.3", | ||
"author": "Brian Vaughn <brian.david.vaughn@gmail.com>", | ||
@@ -66,2 +66,2 @@ "license": "MIT", | ||
} | ||
} | ||
} |
Utility functions shared by [`react-highlight-words`](https://github.com/bvaughn/react-highlight-words) and [`react-native-highlight-words`](https://github.com/clauderic/react-native-highlight-words). | ||
--- | ||
### 🎉 [Become a sponsor](https://github.com/sponsors/bvaughn/) or ☕ [Buy me a coffee](http://givebrian.coffee/) | ||
--- | ||
## API | ||
@@ -4,0 +8,0 @@ |
@@ -60,5 +60,5 @@ // @flow | ||
const prevChunk = processedChunks.pop() | ||
if (nextChunk.start <= prevChunk.end) { | ||
if (nextChunk.start < prevChunk.end) { | ||
// It may be the case that prevChunk completely surrounds nextChunk, so take the | ||
// largest of the end indeces. | ||
// largest of the end indexes. | ||
const endIndex = Math.max(prevChunk.end, nextChunk.end) | ||
@@ -65,0 +65,0 @@ processedChunks.push({highlight: false, start: prevChunk.start, end: endIndex}) |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
31469
55