aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2014-12-23 14:20:19 -0400
committerJoey Hess <joeyh@joeyh.name>2014-12-23 14:20:19 -0400
commit9f62caaff7676ee87d7ab348064a8f8a93f488ac (patch)
treeb0696b702698af309059513edc721c963644fd2c
parent01571ae1fe07562c9938ab930dfc5280fe6346a0 (diff)
parent97f8b33c1a65fbd1e409e073ec152661e8bff74c (diff)
downloadikiwiki-9f62caaff7676ee87d7ab348064a8f8a93f488ac.tar
ikiwiki-9f62caaff7676ee87d7ab348064a8f8a93f488ac.tar.gz
Merge branch 'master' of ssh://git.ikiwiki.info
-rwxr-xr-xt/textile-double-escape-bug.t30
1 files changed, 30 insertions, 0 deletions
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{<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},
+ ));
+ isnt($txtl_html, $good);
+ is($txtl_html, q{<p><a href="https://en.wikipedia.org/wiki/G&amp;ouml;del,_Escher,_Bach">G&ouml;del, Escher, Bach</a></p>});
+};