6 use Test::More tests => 4;
11 use_ok('IkiWiki::Plugin::mdwn');
12 use_ok('IkiWiki::Plugin::textile');
15 subtest 'Text::Textile apparently double-escapes HTML entities in hrefs' => sub {
16 my $text = q{Gödel, Escher, Bach};
17 my $text_ok = qr{G(?:ö|ö|ö|&#x[fF]6;)del, Escher, Bach};
18 my $href = q{https://en.wikipedia.org/wiki/Gödel,_Escher,_Bach};
19 my $href_ok = qr{https://en\.wikipedia\.org/wiki/G(?:ö|ö|ö|&#x[fF]6|%[cC]3%[bB]6)del,_Escher,_Bach};
20 my $good = qr{<p><a href="$href_ok">$text_ok</a></p>};
22 chomp(my $mdwn_html = IkiWiki::Plugin::mdwn::htmlize(
23 content => qq{[$text]($href)},
25 like($mdwn_html, $good);
27 chomp(my $txtl_html = IkiWiki::Plugin::textile::htmlize(
28 content => qq{"$text":$href},
31 local $TODO = "Text::Textile double-escapes the href";
32 like($txtl_html, $good);
33 unlike($txtl_html, qr{<p><a href="https://en\.wikipedia\.org/wiki/G&ouml;del,_Escher,_Bach">Gödel, Escher, Bach</a></p>}i);