217 |
my $text = shift || return; |
my $text = shift || return; |
218 |
|
|
219 |
# don't re-escape html |
# don't re-escape html |
220 |
#return $text if ($text =~ /&(:?lt|gt|amp|quot);/); |
#return $text if ($text =~ /&(?:lt|gt|amp|quot);/); |
221 |
|
|
222 |
# Escape <, >, & and ", and to produce valid XML |
# Escape <, >, & and ", and to produce valid XML |
223 |
my %escape = ('<'=>'<', '>'=>'>', '&'=>'&', '"'=>'"'); |
my %escape = ('<'=>'<', '>'=>'>', '&'=>'&', '"'=>'"'); |
236 |
my $text = shift; |
my $text = shift; |
237 |
|
|
238 |
# remove quote |
# remove quote |
239 |
$text =~ s/^[\>:\|=]+\s*.*?$/#-q-#/msg; |
$text =~ s/^[\>:\|=]+[^\n\r]*[\n\r]*$/#-q-#/msg; |
240 |
# remove quote author |
# remove quote author |
241 |
$text =~ s/[\n\r]+[^\n\r]+:\s*(:?#-q-#[\n\r*])+//gs; |
$text =~ s/[\n\r]+[^\n\r]+:\s*(?:#-q-#[\n\r*])+//gs; |
242 |
$text =~ s/^[^\n\r]+:\s*(:?#-q-#[\n\r]*)+//gs; |
$text =~ s/^[^\n\r]+:\s*(?:#-q-#[\n\r]*)+//gs; |
243 |
$text =~ s/#-q-#[\n\r]*//gs; |
$text =~ s/#-q-#[\n\r]*//gs; |
244 |
# outlook quoting |
# outlook quoting |
245 |
$text =~ s/(\s*--+\s*Original\s+Message\s*--+.*)$//si; |
$text =~ s/(\s*--+\s*Original\s+Message\s*--+.*)$//si; |
281 |
} |
} |
282 |
|
|
283 |
# find quoted text |
# find quoted text |
284 |
$text =~ s/^([\>:\|=]+\s*.*?)$/#-#quote1##$1##quote1#-#/msg; |
$text =~ s/^([\>:\|=]+[^\n\r]*[\n\r]*)$/#-#quote1##$1##quote1#-#/mg; |
285 |
$text =~ s/(--+\s*Original\s+Message\s*--+.*)$/#-#quote2##$1##quote2#-#/si; |
$text =~ s/(--+\s*Original\s+Message\s*--+.*)$/#-#quote2##$1##quote2#-#/si; |
286 |
$text =~ s/(--+\s*Forwarded\s+message.+\s*--+.*)$/#-#quote3##$1##quote3#-#/si; |
$text =~ s/(--+\s*Forwarded\s+message.+\s*--+.*)$/#-#quote3##$1##quote3#-#/si; |
287 |
|
|