From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jean Delvare Subject: [PATCH 2/2] sensors-detect: Generate XHTML 1.0 compliant markup Date: Fri, 31 May 2013 14:21:31 +0200 Message-ID: <20130531142131.5b7c6112@endymion.delvare> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Return-path: Sender: linux-i2c-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Linux I2C List-Id: linux-i2c@vger.kernel.org In HTML output mode, generate XHTML 1.0 compliant markup. --- eeprom/decode-dimms | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) --- i2c-tools.orig/eeprom/decode-dimms 2013-05-31 14:08:38.414677214 +0200 +++ i2c-tools/eeprom/decode-dimms 2013-05-31 14:14:19.065234816 +0200 @@ -413,7 +413,7 @@ sub html_encode($) $text =~ s//\>/sg; $text =~ s/ degrees C/\°C/sg; - $text =~ s/\n/
\n/sg; + $text =~ s/\n/\n/sg; return $text; } @@ -438,11 +438,11 @@ sub real_printl($$) # print a line w/ la if ($opt_html) { $label = html_encode($label); @values = map { html_encode($_) } @values; - print "$label"; + print "$label"; if (!$opt_merge) { print "$_" foreach @values; } elsif ($same_values) { - print "$values[0]"; + print "$values[0]"; } else { # For HTML output, merge adjacent cells even if # the whole line cannot be merged. @@ -451,7 +451,7 @@ sub real_printl($$) # print a line w/ la $colcnt++; my $value = shift @values; next if (@values && $value eq $values[0]); - print " 1 ? " colspan=$colcnt" : "") .">$value"; + print " 1 ? " colspan=\"$colcnt\"" : "") .">$value"; $colcnt = 0; } } @@ -508,7 +508,7 @@ sub real_prints($) # print separator w/ $ncol = 1 unless $ncol; if ($opt_html) { $label = html_encode($label); - print "$label\n"; + print "$label\n"; } else { print "\n---=== $label ===---\n"; } @@ -2167,9 +2167,10 @@ if (!$opt_igncheck) { if ($opt_html && !$opt_bodyonly) { - print "\n", - "\n", - "\t\n", + print "\n\n", + "\n", + "\n", + "\t\n", "\tPC DIMM Serial Presence Detect Tester/Decoder Output\n", "\n"; } @@ -2355,7 +2356,7 @@ for $current (0 .. $#dimm) { printl2("\n\nDecoding EEPROM", $dimm[$current]->{file}, "text-decoration: underline; font-weight: bold;"); } - print "\n" if $opt_html; + print "
\n" if $opt_html; my @output = @{$dimm[$current]->{output}}; for (my $line = 0; $line < @output; $line++) { -- Jean Delvare