| 1 | # Copyrights 2001-2022 by [Mark Overmeer <markov@cpan.org>]. | ||
| 2 | # For other contributors see ChangeLog. | ||
| 3 | # See the manual pages for details on the licensing terms. | ||
| 4 | # Pod stripped from pm file by OODoc 2.03. | ||
| 5 | # This code is part of distribution Mail-Message. Meta-POD processed with | ||
| 6 | # OODoc into POD and HTML manual-pages. See README.md | ||
| 7 | # Copyright Mark Overmeer. Licensed under the same terms as Perl itself. | ||
| 8 | |||
| 9 | package Mail::Message::Convert::TextAutoformat; | ||
| 10 | use vars '$VERSION'; | ||
| 11 | $VERSION = '3.012'; | ||
| 12 | |||
| 13 | use base 'Mail::Message::Convert'; | ||
| 14 | |||
| 15 | use strict; | ||
| 16 | use warnings; | ||
| 17 | |||
| 18 | use Mail::Message::Body::String; | ||
| 19 | use Text::Autoformat; | ||
| 20 | |||
| 21 | |||
| 22 | sub init($) | ||
| 23 | { my ($self, $args) = @_; | ||
| 24 | |||
| 25 | $self->SUPER::init($args); | ||
| 26 | |||
| 27 | $self->{MMCA_options} = $args->{autoformat} || { all => 1 }; | ||
| 28 | $self; | ||
| 29 | } | ||
| 30 | |||
| 31 | #------------------------------------------ | ||
| 32 | |||
| 33 | |||
| 34 | sub autoformatBody($) | ||
| 35 | { my ($self, $body) = @_; | ||
| 36 | |||
| 37 | ref($body)->new | ||
| 38 | ( based_on => $body | ||
| 39 | , data => autoformat($body->string, $self->{MMCA_options}) | ||
| 40 | ); | ||
| 41 | } | ||
| 42 | |||
| 43 | #------------------------------------------ | ||
| 44 | |||
| 45 | 1; |