Skip to content
This repository has been archived by the owner on Oct 15, 2022. It is now read-only.

Remove html_enc from few IA Goodies #3568

Merged
merged 5 commits into from Sep 2, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/DDG/Goodie/CurrencyIn.pm
Expand Up @@ -55,7 +55,7 @@ handle remainder => sub {

$country = $countries->{$country};
my @currencies = @{$country->{"currencies"}};
my $output_country = html_enc($country->{"ucwords"});
my $output_country = $country->{"ucwords"};

if (scalar @currencies eq 1) {
return $currencies[0]{"string"}, structured_answer => {
Expand Down
6 changes: 3 additions & 3 deletions lib/DDG/Goodie/EmailValidator.pm
Expand Up @@ -36,7 +36,7 @@ handle remainder => sub {
my $message;
if (!$result) {
if (defined $message_part->{$email_valid->details}) {
$message = "$address is invalid. Please check the " . $message_part->{$email_valid->details} . ".";
$message = "$address is invalid. Please check the $message_part->{$email_valid->details}.";
}
$message ||= 'E-mail address $address is invalid.';
} else {
Expand All @@ -45,8 +45,8 @@ handle remainder => sub {

return $message, structured_answer => {
data => {
title => html_enc($message),
subtitle => 'Email address validation: '.html_enc($address)
title => $message,
subtitle => "Email address validation: $address"
},
templates => {
group => 'text'
Expand Down
2 changes: 1 addition & 1 deletion lib/DDG/Goodie/HexToASCII.pm
Expand Up @@ -103,7 +103,7 @@ sub printable_chr {
$representation->{pure} = ''; # Don't want to add any printable whitespace and wonder what happened.
} else {
# This must be a printable character, so just let chr figure it out
$representation->{html} = html_enc($representation->{pure} = chr $hex);
$representation->{html} = $representation->{pure} = chr $hex;
}

return $representation;
Expand Down
4 changes: 2 additions & 2 deletions lib/DDG/Goodie/Lowercase.pm
Expand Up @@ -20,8 +20,8 @@ handle remainder => sub {

return $lower, structured_answer => {
data => {
title => html_enc($lower),
subtitle => "Lowercase: " . html_enc($input)
title => $lower,
subtitle => "Lowercase: $input"
},
templates => {
group => 'text',
Expand Down
4 changes: 1 addition & 3 deletions lib/DDG/Goodie/MacAddress.pm
Expand Up @@ -41,9 +41,7 @@ handle remainder => sub {
my ($oui) = uc(substr($_, 0, 6));
my ($info) = $oui_db{$oui};
return unless $info;
my (@vendor) = split(/\\n/, $info, 2);

my ($name, $addr) = map { html_enc($_); } @vendor;
my ($name, $addr) = split(/\\n/, $info, 2);
$addr = "No associated address" unless defined $addr;

# If the info is all capitals, then try to add in some best guesses for
Expand Down
2 changes: 1 addition & 1 deletion lib/DDG/Goodie/MagicEightBall.pm
Expand Up @@ -43,7 +43,7 @@ handle remainder => sub {
return $response, structured_answer => {
data => {
title => $response,
subtitle => "Magic eight ball's answer to: ".html_enc($_)
subtitle => "Magic eight ball's answer to: $_"
},
templates => {
group => 'text'
Expand Down
4 changes: 2 additions & 2 deletions lib/DDG/Goodie/Morse.pm
Expand Up @@ -22,8 +22,8 @@ handle remainder => sub {

return $result, structured_answer => {
data => {
title => html_enc($result),
subtitle => 'Morse code conversion: '.html_enc($input)
title => $result,
subtitle => "Morse code conversion: $input"
},
templates => {
group => 'text'
Expand Down
2 changes: 1 addition & 1 deletion lib/DDG/Goodie/NoteFrequency.pm
Expand Up @@ -66,7 +66,7 @@ handle remainder => sub {
structured_answer => {
data => {
title => $frequency." Hz",
subtitle => "Note Frequency: " . html_enc($letter.$accidental.$octave." in A".$tuning." tuning"),
subtitle => "Note Frequency: $letter$accidental$octave in A$tuning tuning",
},
templates => {
group => 'text',
Expand Down
2 changes: 1 addition & 1 deletion lib/DDG/Goodie/PaleoIngredientCheck.pm
Expand Up @@ -41,7 +41,7 @@ handle remainder => sub {
return $result, structured_answer => {
data => {
title => $result,
subtitle => "Paleo Friendly: ".html_enc($item)
subtitle => "Paleo Friendly: $item"
},
templates => {
group => 'text'
Expand Down
2 changes: 1 addition & 1 deletion lib/DDG/Goodie/PhoneAlphabet.pm
Expand Up @@ -25,7 +25,7 @@ handle remainder => sub {
return "Phone Number: $num", structured_answer => {
data => {
title => $num,
subtitle => "Phone Number: ".html_enc($input)
subtitle => "Phone Number: $input"
},
templates => {
group => 'text'
Expand Down
4 changes: 2 additions & 2 deletions lib/DDG/Goodie/PigLatin.pm
Expand Up @@ -39,8 +39,8 @@ handle query => sub {

return $result, structured_answer => {
data => {
title => html_enc("$result"),
subtitle => html_enc("Translate $action Pig Latin: $to_translate"),
title => "$result",
subtitle => "Translate $action Pig Latin: $to_translate",
},
templates => {
group => 'text',
Expand Down
4 changes: 2 additions & 2 deletions lib/DDG/Goodie/Rc4.pm
Expand Up @@ -45,8 +45,8 @@ handle remainder => sub {

return "$operation: $plaintext, with key: $key is $result", structured_answer => {
data => {
title => html_enc($result),
subtitle => "$operation: " . html_enc($plaintext) . ", Key: ".html_enc($key)
title => $result,
subtitle => "$operation: $plaintext, Key: $key"
},
templates => {
group => 'text'
Expand Down
4 changes: 2 additions & 2 deletions lib/DDG/Goodie/Reverse.pm
Expand Up @@ -21,8 +21,8 @@ handle remainder => sub {

return qq|Reversed "$_": | . $out, structured_answer => {
data => {
title => html_enc($out),
subtitle => "Reverse string: ".html_enc($in)
title => $out,
subtitle => "Reverse string: $in"
},
templates => {
group => 'text'
Expand Down