Remove use of 'html_enc' (#3567)
* removed html_enc from ABC,ANAGRAM,AVERAGE,BASE64,BITSUM,CHARS * string interpolation fixed * string interpolation fixmaster
parent
1b73ba6955
commit
f79cef4cf4
|
@ -38,14 +38,14 @@ handle remainder => sub {
|
||||||
|
|
||||||
# Multi-inputs to single input.
|
# Multi-inputs to single input.
|
||||||
my $last = pop @choices;
|
my $last = pop @choices;
|
||||||
my $choice_string = join(', ', @choices) . ' or ' . $last;
|
my $choice_string = join(', ', @choices) ." or $last";
|
||||||
my $operation = $selection_type . ' selection from';
|
my $operation = "$selection_type selection from";
|
||||||
|
|
||||||
return $selection . " (" . $selection_type . ")",
|
return "$selection ($selection_type)",
|
||||||
structured_answer => {
|
structured_answer => {
|
||||||
data => {
|
data => {
|
||||||
title => html_enc("$selection"),
|
title => "$selection",
|
||||||
subtitle => html_enc("$operation: $choice_string")
|
subtitle => "$operation: $choice_string"
|
||||||
},
|
},
|
||||||
templates => {
|
templates => {
|
||||||
group => 'text',
|
group => 'text',
|
||||||
|
|
|
@ -95,8 +95,8 @@ handle remainder => sub {
|
||||||
return $response,
|
return $response,
|
||||||
structured_answer => {
|
structured_answer => {
|
||||||
data => {
|
data => {
|
||||||
title => html_enc($response),
|
title => $response,
|
||||||
subtitle => $operation . ' ' . html_enc($word)
|
subtitle => "$operation $word"
|
||||||
},
|
},
|
||||||
templates => {
|
templates => {
|
||||||
group => 'text',
|
group => 'text',
|
||||||
|
|
|
@ -72,8 +72,8 @@ handle remainder => sub {
|
||||||
return "$type: $result",
|
return "$type: $result",
|
||||||
structured_answer => {
|
structured_answer => {
|
||||||
data => {
|
data => {
|
||||||
title => html_enc($result),
|
title => $result,
|
||||||
subtitle => $type . ' of: ' . html_enc($_)
|
subtitle => "$type of: $_"
|
||||||
},
|
},
|
||||||
templates => {
|
templates => {
|
||||||
group => 'text'
|
group => 'text'
|
||||||
|
|
|
@ -19,12 +19,12 @@ handle remainder => sub {
|
||||||
|
|
||||||
my $output = perform_conversion($command, $input);
|
my $output = perform_conversion($command, $input);
|
||||||
|
|
||||||
my $operation = 'Base64 ' . $command;
|
my $operation = "Base64 $command";
|
||||||
return $operation . 'd: ' . $output,
|
return "$operation d: $output",
|
||||||
structured_answer => {
|
structured_answer => {
|
||||||
data => {
|
data => {
|
||||||
title => html_enc($output),
|
title => $output,
|
||||||
subtitle => $operation . ': ' . html_enc($input)
|
subtitle => "$operation: $input"
|
||||||
},
|
},
|
||||||
templates => {
|
templates => {
|
||||||
group => 'text'
|
group => 'text'
|
||||||
|
|
|
@ -44,13 +44,13 @@ handle remainder => sub {
|
||||||
|
|
||||||
# Count ones
|
# Count ones
|
||||||
my $result = $binstring =~ tr/1/1/;
|
my $result = $binstring =~ tr/1/1/;
|
||||||
$input_number .= ' (Base '.$base.', '.$base_string.')';
|
$input_number = "$input_number (Base $base, $base_string)";
|
||||||
|
|
||||||
return $result,
|
return $result,
|
||||||
structured_answer => {
|
structured_answer => {
|
||||||
data => {
|
data => {
|
||||||
title => html_enc($result),
|
title => $result,
|
||||||
subtitle => 'Hamming Weight Calculation: ' . html_enc($input_number)
|
subtitle => "Hamming Weight Calculation: $input_number"
|
||||||
},
|
},
|
||||||
templates => {
|
templates => {
|
||||||
group => 'text'
|
group => 'text'
|
||||||
|
|
|
@ -51,7 +51,7 @@ handle remainder => sub {
|
||||||
structured_answer => {
|
structured_answer => {
|
||||||
data => {
|
data => {
|
||||||
title => $len,
|
title => $len,
|
||||||
subtitle => 'Character count: ' . html_enc($str)
|
subtitle => "Character count: $str"
|
||||||
},
|
},
|
||||||
templates => {
|
templates => {
|
||||||
group => 'text'
|
group => 'text'
|
||||||
|
|
|
@ -15,7 +15,7 @@ sub build_structured_answer {
|
||||||
structured_answer => {
|
structured_answer => {
|
||||||
data => {
|
data => {
|
||||||
title => $result,
|
title => $result,
|
||||||
subtitle => $type . ' of: ' . $input
|
subtitle => "$type of: $input"
|
||||||
},
|
},
|
||||||
templates => {
|
templates => {
|
||||||
group => 'text'
|
group => 'text'
|
||||||
|
|
|
@ -11,11 +11,11 @@ zci is_cached => 1;
|
||||||
|
|
||||||
sub build_structured_answer {
|
sub build_structured_answer {
|
||||||
my ($input, $operation, $output) = @_;
|
my ($input, $operation, $output) = @_;
|
||||||
return $operation . 'd: ' . $output,
|
return "$operation d: $output",
|
||||||
structured_answer => {
|
structured_answer => {
|
||||||
data => {
|
data => {
|
||||||
title => $output,
|
title => $output,
|
||||||
subtitle => $operation . ': ' . $input
|
subtitle => "$operation: $input"
|
||||||
},
|
},
|
||||||
templates => {
|
templates => {
|
||||||
group => 'text'
|
group => 'text'
|
||||||
|
|
|
@ -15,7 +15,7 @@ sub build_structured_answer {
|
||||||
structured_answer => {
|
structured_answer => {
|
||||||
data => {
|
data => {
|
||||||
title => $result,
|
title => $result,
|
||||||
subtitle => 'Hamming Weight Calculation: ' . $input_number
|
subtitle => "Hamming Weight Calculation: $input_number"
|
||||||
},
|
},
|
||||||
templates => {
|
templates => {
|
||||||
group => 'text'
|
group => 'text'
|
||||||
|
|
|
@ -20,7 +20,7 @@ sub build_structured_answer {
|
||||||
structured_answer => {
|
structured_answer => {
|
||||||
data => {
|
data => {
|
||||||
title => $len,
|
title => $len,
|
||||||
subtitle => 'Character count: ' . $str
|
subtitle => "Character count: $str"
|
||||||
},
|
},
|
||||||
templates => {
|
templates => {
|
||||||
group => 'text'
|
group => 'text'
|
||||||
|
|
Loading…
Reference in New Issue