-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Applied patch from Johannes Plunien to add an option to disable any H…
…TML entity encoding (this is off by default). Version bump to 2.10.
- Loading branch information
1 parent
82c197c
commit 919a93a
Showing
4 changed files
with
111 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,4 +9,5 @@ t/02paragraph.t | |
t/03url.t | ||
t/04list.t | ||
t/05combined.t | ||
t/06disable_encode_entities.t | ||
t/pod.t |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
use warnings; | ||
use strict; | ||
use Test::More tests => 2; | ||
use Text::Textile; | ||
|
||
{ | ||
my $tt = Text::Textile->new( disable_encode_entities => 1 ); | ||
|
||
my $source = <<SOURCE; | ||
start paragraph | ||
another paragraph | ||
* list of things with "urls":http://www.jerakeen.org in | ||
* more things in the list | ||
a http://bare.url.here. and an email\@address.com | ||
>>> No encode_entities here | ||
<<< and there | ||
&&& and here too | ||
SOURCE | ||
|
||
my $dest = $tt->process($source); | ||
$dest =~ s/(^\s+|\s+$)//g; | ||
|
||
my $expected = <<EXPECTED; | ||
<p>start paragraph</p> | ||
<p>another paragraph</p> | ||
<ul> | ||
<li>list of things with <a href="http://www.jerakeen.org">urls</a> in</li> | ||
<li>more things in the list</li> | ||
</ul> | ||
<p>a http://bare.url.here. and an email\@address.com</p> | ||
<p>>>> No encode_entities here<br /> | ||
<<< and there<br /> | ||
&&& and here too</p> | ||
EXPECTED | ||
$expected =~ s/(^\s+|\s+$)//g; | ||
|
||
is( $dest, $expected ); | ||
} | ||
|
||
{ | ||
my $tt = Text::Textile->new( disable_encode_entities => 0 ); | ||
|
||
my $source = <<SOURCE; | ||
start paragraph | ||
another paragraph | ||
* list of things with "urls":http://www.jerakeen.org in | ||
* more things in the list | ||
a http://bare.url.here. and an email\@address.com | ||
>>> encode_entities here | ||
<<< and there | ||
&&& and here too | ||
SOURCE | ||
|
||
my $dest = $tt->process($source); | ||
$dest =~ s/(^\s+|\s+$)//g; | ||
|
||
my $expected = <<EXPECTED; | ||
<p>start paragraph</p> | ||
<p>another paragraph</p> | ||
<ul> | ||
<li>list of things with <a href="http://www.jerakeen.org">urls</a> in</li> | ||
<li>more things in the list</li> | ||
</ul> | ||
<p>a http://bare.url.here. and an email\@address.com</p> | ||
<p>>>> encode_entities here<br /> | ||
<<< and there<br /> | ||
&&& and here too</p> | ||
EXPECTED | ||
$expected =~ s/(^\s+|\s+$)//g; | ||
|
||
is( $dest, $expected ); | ||
} |