Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

formatting changes

  • Loading branch information...
commit 19562b378c43a46837dd3d4c3410c37f0b067db2 1 parent 82d0ecf
@nospampleasemam nospampleasemam authored
Showing with 8 additions and 7 deletions.
  1. +3 −2 lib/DDG/Goodie/ResistorColors.pm
  2. +5 −5 t/ResistorColors.t
View
5 lib/DDG/Goodie/ResistorColors.pm
@@ -128,7 +128,8 @@ sub render {
my $formatted_value = format_value($value);
my $ohms = $formatted_value eq '1' ? 'ohm' : 'ohms';
my $text = "$formatted_value\x{2126} ($ohms) resistor colors:";
- my $html = "$formatted_valueΩ ($ohms) resistor colors:";
+ my $html = "<span style='margin-right:4px;'>"
+ . "$formatted_value&#x2126; ($ohms) resistor colors:</span>";
#while (my ($index, $digit) = each @$digits) {
my $index = 0;
@@ -138,7 +139,7 @@ sub render {
my $hex = $digits_to_colors{$digit}{hex};
my $label = $digits_to_colors{$digit}{label};
my $style = "display:inline-block;background-color:$hex;color:$label;"
- . "border:1px solid #c8c8c8;margin-top:-1px;padding:0px 4px;"
+ . "border:1px solid #c8c8c8;margin-top:-1px;padding:0px 5px 3px;"
. "border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px;";
my ($text_prefix, $html_prefix, $display_digit);
if ($index == scalar(@$digits) - 2) {
View
10 t/ResistorColors.t
@@ -81,18 +81,18 @@ ddg_goodie_test(
# Check the HTML. Just once.
"1.5m ohm" => test_zci("1.5M\x{2126} (ohms) resistor colors: brown (1), green (5), green (\x{00D7}100K), gold (\x{00B1}5%)", html =>
- "1.5M&#x2126; (ohms) resistor colors: "
+ "<span style='margin-right:4px;'>1.5M&#x2126; (ohms) resistor colors:</span> "
. "<span style='display:inline-block;background-color:#964b00;"
- . "color:#fff;border:1px solid #c8c8c8;margin-top:-1px;padding:0px 4px;border-radius:4px;"
+ . "color:#fff;border:1px solid #c8c8c8;margin-top:-1px;padding:0px 5px 3px;border-radius:4px;"
. "-webkit-border-radius:4px;-moz-border-radius:4px;'>brown (1)</span> "
. "<span style='display:inline-block;background-color:#9acd32;"
- . "color:#000;border:1px solid #c8c8c8;margin-top:-1px;padding:0px 4px;border-radius:4px;"
+ . "color:#000;border:1px solid #c8c8c8;margin-top:-1px;padding:0px 5px 3px;border-radius:4px;"
. "-webkit-border-radius:4px;-moz-border-radius:4px;'>green (5)</span> "
. "<span style='display:inline-block;background-color:#9acd32;"
- . "color:#000;border:1px solid #c8c8c8;margin-top:-1px;padding:0px 4px;border-radius:4px;"
+ . "color:#000;border:1px solid #c8c8c8;margin-top:-1px;padding:0px 5px 3px;border-radius:4px;"
. "-webkit-border-radius:4px;-moz-border-radius:4px;'>green (&times;100K)</span> "
. "<span style='display:inline-block;background-color:#cfb53b;"
- . "color:#000;border:1px solid #c8c8c8;margin-top:-1px;padding:0px 4px;border-radius:4px;"
+ . "color:#000;border:1px solid #c8c8c8;margin-top:-1px;padding:0px 5px 3px;border-radius:4px;"
. "-webkit-border-radius:4px;-moz-border-radius:4px;'>gold (&plusmn;5%)</span>"
. "<br/><a href='http://resisto.rs/#1.5M' style='font-size:92.8%'>More at resisto.rs</a>"),
Please sign in to comment.
Something went wrong with that request. Please try again.