Do not filter body ranges if there are none
This commit is contained in:
parent
965c635905
commit
6eba9350be
1 changed files with 4 additions and 0 deletions
|
@ -92,6 +92,10 @@ function getFilteredBodyRanges(
|
||||||
body: string,
|
body: string,
|
||||||
bodyRanges: BodyRangesType
|
bodyRanges: BodyRangesType
|
||||||
): BodyRangesType {
|
): BodyRangesType {
|
||||||
|
if (!bodyRanges.length) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
// Find where the snippet starts in the full text
|
// Find where the snippet starts in the full text
|
||||||
const stripped = snippet
|
const stripped = snippet
|
||||||
.replace(/<<left>>/g, '')
|
.replace(/<<left>>/g, '')
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue