Skip to content

Commit 52de002

Browse files
committed
Add TODO tests for =begin html bug.
BlackBox's `_ponder_end` should probably concatenate all of the text collected in text tokens since `_ponder_begin` in order to make the text inside the begin block truly verbatim. Otherwise Pod::Simple::HTML adds unwanted newlines, while Pod::Simple::XHTML seems to remove them. See RT #91851 for more details on this bug, which dates back to 2002!
1 parent cb884b5 commit 52de002

File tree

2 files changed

+42
-2
lines changed

2 files changed

+42
-2
lines changed

t/html01.t

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ BEGIN {
99

1010
use strict;
1111
use Test;
12-
BEGIN { plan tests => 12 };
12+
BEGIN { plan tests => 13, todo => [11] };
1313

1414
#use Pod::Simple::Debug (10);
1515

@@ -103,6 +103,25 @@ ok(
103103
}
104104
);
105105

106+
my $html = q{
107+
<tt>
108+
<pre>
109+
#include &lt;stdio.h&gt;
110+
111+
int main(int argc,char *argv[]) {
112+
113+
printf("Hellow World\n");
114+
return 0;
115+
116+
}
117+
</pre>
118+
</tt>
119+
};
120+
ok(
121+
x("=begin html\n\n$html\n\n=end html\n"),
122+
$html
123+
);
124+
106125
# Check subclass.
107126
SUBCLASS: {
108127
package My::Pod::HTML;

t/xhtml01.t

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ BEGIN {
88

99
use strict;
1010
use lib '../lib';
11-
use Test::More tests => 61;
11+
use Test::More tests => 62;
1212
#use Test::More 'no_plan';
1313

1414
use_ok('Pod::Simple::XHTML') or exit;
@@ -660,6 +660,27 @@ is($results, <<"EOHTML", "Text with numeric entities");
660660
661661
EOHTML
662662

663+
my $html = q{
664+
<tt>
665+
<pre>
666+
#include &lt;stdio.h&gt;
667+
668+
int main(int argc,char *argv[]) {
669+
670+
printf("Hellow World\n");
671+
return 0;
672+
673+
}
674+
</pre>
675+
</tt>
676+
};
677+
initialize($parser, $results);
678+
$parser->parse_string_document("=begin html\n\n$html\n\n=end html\n");
679+
TODO: {
680+
local $TODO = '=begin block text not properly parsed';
681+
is($results, $html, "Text with =begin html");
682+
}
683+
663684
SKIP: for my $use_html_entities (0, 1) {
664685
if ($use_html_entities and not $Pod::Simple::XHTML::HAS_HTML_ENTITIES) {
665686
skip("HTML::Entities not installed", 3);

0 commit comments

Comments
 (0)