Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #611 from metacpan/haarg/pod-errors-use-class
use classes rather than ids for pod error output
  • Loading branch information
mickeyn committed Jan 18, 2017
2 parents 001537c + 731dd7f commit fc85fdb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
6 changes: 3 additions & 3 deletions lib/MetaCPAN/Pod/XHTML.pm
Expand Up @@ -160,11 +160,11 @@ sub _emit_custom_errata {

$self->{'scratch'} = $tag->(
'div',
{ id => "pod-errors" },
$tag->( 'p', { class => 'title' }, "$error_count POD Error$s" ),
{ class => "pod-errors" },
$tag->( 'p', "$error_count POD Error$s" ),
$tag->(
'div',
{ id => "pod-error-detail" },
{ class => "pod-errors-detail" },
$tag->(
'p',
'The following errors were encountered while parsing the POD:'
Expand Down
14 changes: 10 additions & 4 deletions t/server/controller/pod.t
Expand Up @@ -133,8 +133,11 @@ while ( my ( $k, $v ) = each %tests ) {
my $res = $test->request( GET $path );
ok( $res, "GET $path" );
is( $res->code, 200, 'code 200' );
unlike( $res->content, qr/<div[^>]*id="pod-errors"/,
'no POD errors section' );
unlike(
$res->content,
qr/<div[^>]*class="pod-errors"/,
'no POD errors section'
);

}

Expand All @@ -143,8 +146,11 @@ while ( my ( $k, $v ) = each %tests ) {
my $res = $test->request( GET $path);
ok( $res, "GET $path" );
is( $res->code, 200, 'code 200' );
like( $res->content, qr/<div[^>]*id="pod-errors"/,
'got POD errors section' );
like(
$res->content,
qr/<div[^>]*class="pod-errors"/,
'got POD errors section'
);

my @err = $res->content =~ m{<dd.*?>(.*?)</dd>}sg;
is( scalar(@err), 2, 'two parse errors listed ' );
Expand Down

0 comments on commit fc85fdb

Please sign in to comment.