• HTML.pm

    97 98  
    269 269 $t1 = $t2 = join ' ', @words[0 .. $args{max_words}-1];
    270 270
    271 271 # magic !
    272 my @wds = split ' ', $t1;
    273 return $t1 if $t1 =~ s/^(.+[\w»")]{3,}[.!?])+\s?[А-ЯA-Z«"].+?$/$1/ and scalar(@wds) > $args{min_words};
    272 s/^(.+\w{3,}[»")]?[.!?]+)\s*[А-ЯA-Z«"].+?$/$1/s and (()=/(\s+)/g)>$args{min_words} and return$_ for $t1;
    274 273
    275 274 $t2 =~ s/[.,:;!?\s—-]+$//;
    276 275 $t2.($args{ending} || '');