Do not filter body ranges if there are none
This commit is contained in:
@@ -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, '')
|
||||||
|
Reference in New Issue
Block a user