Email-MIME-Kit-Assembler-Markdown
view release on metacpan or search on metacpan
0.100004 2016-08-01 22:57:35-04:00 America/New_York
- add the `render_wrapper` option to treat the wrapper as a
text to be rendered rather than a thing with a single token in it
(thanks, Rob Norris!)
0.100003 2015-02-19 13:23:21-05:00 America/New_York
- immutabilize class after construction
0.100002 2015-01-23 15:17:20-05:00 America/New_York
- make more sensibly compatible with Email::MIME::Kit v3's
decoded-text expectations
0.100001 2013-08-12 21:36:07 America/New_York
update bugtracker and repo
0.100000 2011-12-07 12:52:23 America/New_York
add the munge_signature option
0.093071 2011-10-15 18:06:18 Asia/Tokyo
repackage to add META.yml
lib/Email/MIME/Kit/Assembler/Markdown.pm view on Meta::CPAN
push @done_header, $hval[0] => $value;
}
return \@done_header;
}
sub assemble {
my ($self, $stash) = @_;
my $markdown = ${ $self->kit->get_decoded_kit_entry( $self->path ) };
my $plaintext = $markdown;
if ($self->renderer) {
{
local $stash->{part_type} = 'text';
my $output = $self->renderer->render(\$markdown, $stash);
$plaintext = ${ $self->renderer->render(\$markdown, $stash) };
}
lib/Email/MIME/Kit/Assembler/Markdown.pm view on Meta::CPAN
my %content = (
html => Text::Markdown->new(tab_width => 2)->markdown($markdown),
text => $plaintext,
);
for my $type (keys %content) {
my $type_wrapper = "$type\_wrapper";
if (my $wrapper_path = $self->$type_wrapper) {
my $wrapper = ${ $self->kit->get_decoded_kit_entry($wrapper_path) };
if ($self->render_wrapper) {
local $stash->{wrapped_content} = $content{$type};
local $stash->{part_type} = $type;
my $output_ref = $self->renderer->render(\$wrapper, $stash);
$content{$type} = $$output_ref;
} else {
my $marker = $self->marker;
my $marker_re = qr{<!--\s+\Q$marker\E\s+-->};
( run in 0.460 second using v1.01-cache-2.11-cpan-26ccb49234f )