Skip to content

Commit

Permalink
fixed error in jscodes when a key is not found
Browse files Browse the repository at this point in the history
  • Loading branch information
majuscule committed May 21, 2012
1 parent a650bfc commit e9bc58b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/DDG/Goodie/JsKeycodes.pm
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,14 @@ handle remainder => sub {
my $footer = share('footer.txt')->slurp;

$html .= $header;
$html .= '<tr><td class="c1"><b>' . $_ . '</b></td><td class="c2"><b>' . $keys{$_} . '</b></td>' if (exists $keys{$_});
$html .= '<tr><td class="c1"><b>' . $_ . '</b></td><td class="c2"><b>' . $keys{$_} . '</b></td>' if (exists $keys{$_});

foreach $key (sort keys %keys){
$html .= '<tr><td class="c1">' . $key . '</td><td class="c2">'. $keys{$key} . "</td></tr>" unless $key eq $_ ;
$html .= '<tr><td class="c1">' . $key . '</td><td class="c2">'. $keys{$key} . "</td></tr>" unless $key eq $_;
};

$html .= $footer;
$text = 'Keycode: ' . $keys{$_} . ' (JavaScript)' unless $_ eq "JavaScript" or $_ eq "javascript";
$text = 'Keycode: ' . $keys{$_} . ' (JavaScript)' unless not exists $keys{$_} or $_ eq "JavaScript" or $_ eq "javascript";
return $text, html => $html;
return;
};
Expand Down

0 comments on commit e9bc58b

Please sign in to comment.