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

Commit 154f75f

Browse files
author
Jag Talon
committed
Merge pull request #503 from duckduckgo/jag/calc-link
Calculator: Bring back the link for the result.
2 parents 8d0b4fb + 668d855 commit 154f75f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/DDG/Goodie/Calculator.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ sub append_css {
200200

201201
sub wrap_html {
202202
my ($entered, $result) = @_;
203-
return append_css("<div class='zci--calculator'>$entered = $result</div>");
203+
return append_css("<div class='zci--calculator'>$entered = <a href='javascript:;' onclick='document.x.q.value=\"$result\";document.x.q.focus();'>$result</a></div>");
204204
}
205205

206206
#separates symbols with a space

t/Calculator.t

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -297,17 +297,17 @@ ddg_goodie_test(
297297
'0.8^2 + 0.6^2' => test_zci(
298298
'0.8 ^ 2 + 0.6 ^ 2 = 1',
299299
heading => 'Calculator',
300-
html => qr#0.8<sup>2</sup> \+ 0.6<sup>2</sup> = 1#,
300+
html => qr#0.8<sup>2</sup> \+ 0.6<sup>2</sup> = #,
301301
),
302302
'2 squared ^ 3' => test_zci(
303303
'2 squared ^ 3 = 256',
304304
heading => 'Calculator',
305-
html => qr#2 squared<sup>3</sup> = 256#,
305+
html => qr#2 squared<sup>3</sup> = #,
306306
),
307307
'2^3 squared' => test_zci(
308308
'2 ^ 3 squared = 512',
309309
heading => 'Calculator',
310-
html => qr#2<sup>3</sup>squared = 512#,
310+
html => qr#2<sup>3</sup>squared = #,
311311
),
312312
'4 score + 7' => test_zci(
313313
'4 score + 7 = 87',

0 commit comments

Comments
 (0)