From 97f8b33c1a65fbd1e409e073ec152661e8bff74c Mon Sep 17 00:00:00 2001 From: Amitai Schlair Date: Mon, 22 Dec 2014 22:43:40 -0500 Subject: Document an annoying Text::Textile encoding bug. --- t/textile-double-escape-bug.t | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100755 t/textile-double-escape-bug.t diff --git a/t/textile-double-escape-bug.t b/t/textile-double-escape-bug.t new file mode 100755 index 000000000..fe73f331b --- /dev/null +++ b/t/textile-double-escape-bug.t @@ -0,0 +1,30 @@ +#!/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{

$text

}; + + 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}, + )); + isnt($txtl_html, $good); + is($txtl_html, q{

Gödel, Escher, Bach

}); +}; -- cgit v1.2.3