- my @sections = split(/((?:^>[^\n]*\n)+)/sm, $s);
- $part = $s = undef;
- index_body($self, $_, /\A>/ ? 0 : $doc) for @sections;
+ my @sections = PublicInbox::MsgIter::split_quotes($s);
+ undef $s; # free memory
+ for my $txt (@sections) {
+ if ($txt =~ /\A>/) {
+ index_text($self, $txt, 0, 'XQUOT');
+ } else {
+ # does it look like a diff?
+ if ($txt =~ /^(?:diff|---|\+\+\+) /ms) {
+ index_diff($self, $txt, $doc);
+ } else {
+ index_text($self, $txt, 1, 'XNQ');
+ }
+ }
+ undef $txt; # free memory
+ }