View | Details | Raw Unified | Return to bug 4881
Collapse All | Expand All

(-)lib/Mail/SpamAssassin/Message.pm (-1 / +12 lines)
Lines 878-885 Link Here
878
    }
879
    }
879
  }
880
  }
880
881
882
  # If the number of double newlines exceeds the number of single
883
  # newlines we have a special formatted mail with a newline between
884
  # each line. Only convert double newlines if this isn't the case.
885
  # 
886
  my @dl = ($text =~ /([^\n]\n+\s*\n+[^\n])/g);
887
  my $dl_count = @dl;
888
  my @ol = ($text =~ /([^\n]\n[^\n])/g);
889
  my $ol_count = @ol;
890
  if ($dl_count < $ol_count) {
891
  	$text =~ s/\n+\s*\n+/\f/gs;		# double newline => form feed
892
  }
893
881
  # whitespace handling (warning: small changes have large effects!)
894
  # whitespace handling (warning: small changes have large effects!)
882
  $text =~ s/\n+\s*\n+/\f/gs;		# double newlines => form feed
883
  $text =~ tr/ \t\n\r\x0b\xa0/ /s;	# whitespace => space
895
  $text =~ tr/ \t\n\r\x0b\xa0/ /s;	# whitespace => space
884
  $text =~ tr/\f/\n/;			# form feeds => newline
896
  $text =~ tr/\f/\n/;			# form feeds => newline
885
  
897
  

Return to bug 4881