blob: 607706be40b0d68d989650b4fd612f7c4a805a4a (
plain)
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
26
27
28
29
30
31
32
33
|
#!/usr/bin/perl
use warnings;
use strict;
use Test::More tests => 4;
use utf8;
BEGIN {
use_ok('IkiWiki');
use_ok('IkiWiki::Plugin::mdwn');
use_ok('IkiWiki::Plugin::textile');
};
subtest 'Text::Textile apparently double-escapes HTML entities in hrefs' => sub {
my $text = q{Gödel, Escher, Bach};
my $href = q{https://en.wikipedia.org/wiki/Gödel,_Escher,_Bach};
my $good = qq{<p><a href="$href">$text</a></p>};
chomp(my $mdwn_html = IkiWiki::Plugin::mdwn::htmlize(
content => qq{[$text]($href)},
));
is($mdwn_html, $good);
chomp(my $txtl_html = IkiWiki::Plugin::textile::htmlize(
content => qq{"$text":$href},
));
TODO: {
local $TODO = "Text::Textile double-escapes the href";
is($txtl_html, $good);
isnt($txtl_html, q{<p><a href="https://en.wikipedia.org/wiki/G&ouml;del,_Escher,_Bach">Gödel, Escher, Bach</a></p>});
}
};
|