Skip to content
This repository was archived by the owner on Jan 19, 2025. It is now read-only.

Commit

Permalink
fix(parsing): skip empty chunk from regex execution
Browse files Browse the repository at this point in the history
  • Loading branch information
louisgrasset committed Oct 8, 2024
1 parent 013bee9 commit 662af4f
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ export const extractWordsAndSpacers = (
const chunksSplitByUrl = [prefixChunk, url, suffixChunk];

for (const currentChunk of chunksSplitByUrl) {
if (!currentChunk) {
continue; // Skip empty chunks
}
entries.push({
str: currentChunk,
sep: getSeparator(remainingText, currentChunk),
Expand Down

0 comments on commit 662af4f

Please sign in to comment.