Remove html_enc() from RandomDate.pm (#3599)

* removed all html_enc()

* fixed some tests still 2 failing

* Update RandomDate.pm
master
Gautam krishna.R 2016-09-05 15:10:02 +05:30 committed by Ben Moon
parent 8cbc36eb2a
commit 94b217af1a
2 changed files with 4 additions and 4 deletions

View File

@ -100,11 +100,11 @@ handle query => sub {
max => $max_date_formatted,
);
return html_enc("$formatted"),
return $formatted,
structured_answer => {
data => {
title => html_enc("$formatted"),
title => $formatted,
subtitle => $subtitle,
},
@ -123,7 +123,7 @@ sub build_subtitle {
? " between $min and $max"
: '';
$type eq 'format'
? "Random date for: " . html_enc($format)
? "Random date for: $format"
: "Random $type$range_text";
}

View File

@ -169,7 +169,7 @@ ddg_goodie_test(
is_standard => 0,
),
# With HTML
'random date for <p>%a</p>' => build_format_test('&lt;p&gt;%a&lt;/p&gt;', qr/&lt;p&gt;$short_name&lt;\/p&gt;/),
'random date for <p>%a</p>' => build_format_test('<p>%a</p>', qr/<p>$short_name<\/p>/),
# With ranges
'random date in the past' => build_range_test('Date', 'min', 'now'),
'random past date' => build_range_test('Date', 'min', 'now'),