From 8b465452b307d511a383242e7dc1ebc839bddc15 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Fri, 7 Jun 2013 06:46:36 +0000 Subject: [PATCH] decode-dimms: Generate XHTML 1.1 compliant markup In HTML output mode, generate XHTML 1.1 compliant markup. git-svn-id: http://lm-sensors.org/svn/i2c-tools/trunk@6183 7894878c-1315-0410-8ee3-d5d059ff63e0 --- CHANGES | 2 +- eeprom/decode-dimms | 24 +++++++++++++----------- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/CHANGES b/CHANGES index d163de0..750d090 100644 --- a/CHANGES +++ b/CHANGES @@ -37,7 +37,7 @@ SVN HEAD Add support for Load Reduced DIMM (LRDIMM) DDR3 modules Fully decode the DDR3 SDRAM Device Type field Encode "degrees" to HTML degree symbol - Generate HTML 4.01 compliant markup + Generate XHTML 1.1 compliant markup i2cdetect: Do a best effort detection if functionality is missing Clarify the SMBus commands used for probing by default i2c-dev.h: Minimize differences with kernel flavor diff --git a/eeprom/decode-dimms b/eeprom/decode-dimms index eb7900e..e1de338 100755 --- a/eeprom/decode-dimms +++ b/eeprom/decode-dimms @@ -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/ label and values 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/ label and values $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/ given text $ncol = 1 unless $ncol; if ($opt_html) { $label = html_encode($label); - print "$label\n"; + print "$label\n"; } else { print "\n---=== $label ===---\n"; } @@ -2167,11 +2167,13 @@ if (!$opt_igncheck) { if ($opt_html && !$opt_bodyonly) { - print "\n", - "\n", - "\t\n", - "\tPC DIMM Serial Presence Detect Tester/Decoder Output\n", - "\n"; + print "\n\n", + "\n", + "\n", + "\t\n", + "\tPC DIMM Serial Presence Detect Tester/Decoder Output\n", + "\n\n", + "\n"; } printc("decode-dimms version $revision"); @@ -2355,7 +2357,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++) {