Aozora2Epub
view release on metacpan or search on metacpan
use strict;
use warnings;
use utf8;
use Test::More;
use Test::Base;
use Aozora2Epub;
use Aozora2Epub::Gensym;
use lib qw/./;
use t::Util;
plan tests => 1 * blocks;
sub drop_nlsp {
my $s = shift;
$s =~ s/\n *//sg;
$s =~ s/\n$//sg;
$s;
}
filters {
html => 'chomp',
expected => 'yaml',
};
run {
my $block = shift;
Aozora2Epub::Gensym->reset_counter;
my $doc = Aozora2Epub->new($block->html, no_fetch_assets=>1);
my $got = [ map { $_->as_html } @{$doc->files} ];
is_deeply($got,
[ map { drop_nlsp($_) } @{$block->expected} ],
$block->name);
};
__DATA__
=== beginning br
--- html
<br/><br />ããããã
--- expected
- ããããã
--- note
æ¬ã®å
é ã®<br/>ã®é£ç¶ã¯åé¤ãããã
=== o-midashi
--- html
ã<br/>
<h3 class="o-midashi">
<a class="midashi_anchor" id="midashi001">è¦åºã</a>
</h3>
ããã
--- expected
- ã
- <br /><h3 class="o-midashi" id="midashi001">è¦åºã</h3> ããã
=== naka-midashi
--- html
ã<br/>
<h4 class="naka-midashi">
<a class="midashi_anchor" id="midashi001">è¦åºã</a>
</h4>
ããã
( run in 1.915 second using v1.01-cache-2.11-cpan-5a3173703d6 )