Skip to content

Commit

Permalink
Fixed universe display in build_toc
Browse files Browse the repository at this point in the history
Because the universe might or might not be an array;
likewise with characters.
  • Loading branch information
rubykat committed Mar 28, 2012
1 parent 3636381 commit f32dba3
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/WWW/FetchStory/Fetcher.pm
Expand Up @@ -1323,7 +1323,12 @@ sub build_toc {
my $filename = sprintf("%s00.html", $info->{basename});

my $html;
my $characters = join( ', ', @{$info->{characters}} );
my $characters = (ref $info->{characters}
? join( ', ', @{$info->{characters}} )
: $info->{characters});
my $universe = (ref $info->{universe}
? join( ', ', @{$info->{universe}} )
: $info->{universe});
$html = <<EOT;
<html>
<head><title>$info->{title}</title></head>
Expand All @@ -1335,7 +1340,7 @@ sub build_toc {
$info->{summary}
</p>
<p><b>Words:</b> $info->{wordcount}<br/>
<b>Universe:</b> $info->{universe}</p>
<b>Universe:</b> $universe</p>
<b>Characters:</b> $characters</p>
<ol>
EOT
Expand Down

0 comments on commit f32dba3

Please sign in to comment.