File: preserve_options.t

package info (click to toggle)
libhtml-formattext-withlinks-andtables-perl 0.07-1~bpo8%2B1
  • links: PTS, VCS
  • area: main
  • in suites: jessie-backports
  • size: 152 kB
  • sloc: perl: 290; makefile: 2
file content (25 lines) | stat: -rw-r--r-- 663 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/perl

use HTML::FormatText::WithLinks::AndTables;
use Test::More tests => 1;
my $html = '
<a href="http://example.com">Link</a>
<table><tr><td><a href="http://example.com/foo">Cell link</a></td></tr></table>';

my $text = HTML::FormatText::WithLinks::AndTables->convert($html, 
{
            footnote        => '',
            after_link      => ' (%l)',
            before_link     => '',
            leftmargin      => 0,
});
print "got: '$text'\n";
my $expected = ' Link (http://example.com)

 Cell link (http://example.com/foo) 

';
#print "expected: '$expected'\n";
ok($text eq $expected,"links inside tables have after_link applied properly");