1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
Description: fix html.tcl conversion script so that output is valid HTML
Author: Giulio Paci <giuliopaci@gmail.com>
Forwarded: yes
Last-Update: 2013-07-02
--- a/convert/html.tcl
+++ b/convert/html.tcl
@@ -27,12 +27,13 @@
set episode [$v(trans,root) getChilds "element" "Episode"]
set bg ""
set basename [quote [file root [file tail $v(sig,name)]]]
- puts $channel "<html>\n<head>\n<title>$basename</title>\n"
+ puts $channel "<?xml version='1.0' encoding='UTF-8' ?>\n<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"
+\"http://www.w3.org/TR/html4/loose.dtd\">\n<html>\n<head>\n<title>$basename</title>\n"
if {![catch {encoding system}]} {
puts $channel "<meta http-equiv=\"ContentType\" content=\"text/html; charset=$v(encoding)\">"
}
puts $channel "</head>\n<body>"
- puts $channel "<h1><center>$basename</center></h1>"
+ puts $channel "<center><h1>$basename</h1></center>"
puts $channel [quote "Program [$episode getAttr program]"]
puts $channel [quote "of [$episode getAttr air_date]"]
puts $channel "<br>"
@@ -41,7 +42,7 @@
puts $channel [quote "of [$v(trans,root) getAttr version_date]"]
foreach sec [$episode getChilds "element" "Section"] {
set topic [::section::long_name $sec]
- puts $channel "<h2><center><font color=\"\#990000\">[quote $topic]</font></center></h2>"
+ puts $channel "<center><h2><font color=\"\#990000\">[quote $topic]</font></h2></center>"
set turns [$sec getChilds "element" "Turn"]
for {set nt 0} {$nt < [llength $turns]} {incr nt} {
set tur [lindex $turns $nt]
|