File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -657,10 +657,12 @@ export async function generateWords(
657657 ret . sectionIndexes . push ( nextWord . sectionIndex ) ;
658658
659659 if ( Config . mode === "custom" && CustomText . getPipeDelimiter ( ) ) {
660+ //generate a given number of sections, make sure to not cut a section off
660661 const sectionFinishedAndOverLimit =
661- currentSection . length === 0 &&
662- sectionIndex >= CustomText . getLimitValue ( ) ;
663- if ( sectionFinishedAndOverLimit || ret . words . length >= limit ) {
662+ currentSection . length === 0 && sectionIndex >= limit ;
663+ //make sure we dont go over a hard limit, in cases where the sections are very large
664+ const upperWordLimit = ret . words . length >= 100 ;
665+ if ( sectionFinishedAndOverLimit || upperWordLimit ) {
664666 stop = true ;
665667 }
666668 } else if ( ret . words . length >= limit ) {
You can’t perform that action at this time.
0 commit comments