Fix several html tags to pass w3c's validator.
Fri Jul 1 20:01:39 UTC 2005 Alberto Bertogli <albertogli@telpin.com.ar>
* Fix several html tags to pass w3c's validator.
diff -rN -u old-darcsweb/darcsweb.cgi new-darcsweb/darcsweb.cgi
--- old-darcsweb/darcsweb.cgi 2015-12-31 08:03:46.000000000 +0000
+++ new-darcsweb/darcsweb.cgi 2015-12-31 08:03:46.000000000 +0000
@@ -63,7 +63,7 @@
def printd(*params):
- print string.join(params), '<br>'
+ print string.join(params), '<br/>'
# I _hate_ this.
@@ -196,17 +196,17 @@
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<meta name="robots" content="index, nofollow"/>
<title>darcs - %(reponame)s</title>
-<link rel="stylesheet" type="text/css" href="%(css)s">
+<link rel="stylesheet" type="text/css" href="%(css)s"/>
<link rel="alternate" title="%(reponame)s" href="%(url)s;a=rss"
type="application/rss+xml"/>
-<link rel="shortcut icon" href="%(fav)s">
-<link rel="icon" href="%(fav)s">
+<link rel="shortcut icon" href="%(fav)s"/>
+<link rel="icon" href="%(fav)s"/>
</head>
<body>
<div class="page_header">
-<a href=http://darcs.net title="darcs">
-<img src="%(logo)s" alt="darcs logo" style="float:right; border-width:0px;">
+<a href="http://darcs.net" title="darcs">
+<img src="%(logo)s" alt="darcs logo" style="float:right; border-width:0px;"/>
</a>
""" % {
'reponame': config.reponame,
@@ -229,7 +229,7 @@
crece desde el pie</div>
"""
if put_rss:
- print '<a class=rss_logo href="%s;a=rss">RSS</a>' % \
+ print '<a class="rss_logo" href="%s;a=rss">RSS</a>' % \
(config.myurl + '/' + config.myreponame)
print "</div>\n</body>\n</html>"
@@ -268,7 +268,7 @@
| <a href="%(myreponame)s;a=headfilediff;h=%(hash)s;f=%(fname)s">headfilediff</a>
""" % { "myreponame": config.myreponame, 'hash': h, 'fname': f }
- print '<br><br></div>'
+ print '<br/><br/></div>'
def print_plain_header():
@@ -528,9 +528,9 @@
def print_shortlog(last = 50, topi = 0):
ps = get_last_patches(last, topi)
- print '<div><a class=title href="%s;a=shortlog">shortlog</a></div>' \
+ print '<div><a class="title" href="%s;a=shortlog">shortlog</a></div>' \
% config.myreponame
- print '<table cellspacing=0>'
+ print '<table cellspacing="0">'
if topi != 0:
# put a link to the previous page
@@ -569,8 +569,11 @@
if len(ps) >= last:
# only show if we've not shown them all already
- print '<td><a href="%s;a=shortlog;topi=%d">...</a></td>' % \
- (config.myreponame, topi + last)
+ print """
+<tr><td>
+ <a href="%s;a=shortlog;topi=%d">...</a>
+</td></tr>
+ """ % (config.myreponame, topi + last)
print "</table>"
@@ -582,29 +585,29 @@
ntopi = topi - last
if ntopi < 0:
ntopi = 0
- print '<p><a href="%s;a=log;topi=%d">&lt;- Prev</a><p>' % \
+ print '<p/><a href="%s;a=log;topi=%d">&lt;- Prev</a><p/>' % \
(config.myreponame, ntopi)
for p in ps:
if p.comment:
- fmt_comment = p.comment.replace('\n', '<br>') + '\n'
- fmt_comment += '<br><br>'
+ fmt_comment = p.comment.replace('\n', '<br/>') + '\n'
+ fmt_comment += '<br/><br/>'
else:
fmt_comment = ''
print """
-<div><a class=title href="%(myreponame)s;a=commit;h=%(hash)s">
- <span class=age>%(age)s</span>%(desc)s
+<div><a class="title" href="%(myreponame)s;a=commit;h=%(hash)s">
+ <span class="age">%(age)s</span>%(desc)s
</a></div>
-<div class=title_text>
- <div class=log_link>
+<div class="title_text">
+ <div class="log_link">
<a href="%(myreponame)s;a=commit;h=%(hash)s">commit</a> |
- <a href="%(myreponame)s;a=commitdiff;h=%(hash)s">commitdiff</a><br>
+ <a href="%(myreponame)s;a=commitdiff;h=%(hash)s">commitdiff</a><br/>
</div>
- <i>%(author)s [%(date)s]</i><br>
+ <i>%(author)s [%(date)s]</i><br/>
</div>
<div class="log_body">
- %(desc)s<br>
- <br>
+ %(desc)s<br/>
+ <br/>
%(comment)s
</div>
@@ -614,19 +617,19 @@
'date': p.local_date_str,
'author': p.shortauthor,
'hash': p.hash,
- 'desc': shorten_str(p.name),
- 'comment': fmt_comment
+ 'desc': escape(p.name),
+ 'comment': escape(fmt_comment)
}
if len(ps) >= last:
# only show if we've not shown them all already
- print '<p><a href="%s;a=log;topi=%d">Next -&gt;</a><p>' % \
+ print '<p><a href="%s;a=log;topi=%d">Next -&gt;</a></p>' % \
(config.myreponame, topi + last)
def print_blob(fname):
- print '<div class=page_path><b>%s</b></div>' % fname
- print '<div class=page_body>'
+ print '<div class="page_path"><b>%s</b></div>' % fname
+ print '<div class="page_body">'
if isbinary(fname):
print """
<i>This is a binary file and it's contents will not be displayed.</i>
@@ -641,8 +644,10 @@
if l and l[-1] == '\n':
l = l[:-1]
- print """
-<div class=pre><a id="l%(c)d" href="#l%(c)d" class=linenr>%(c)4d</a> %(l)s</div>
+ print """\
+<div class="pre">\
+<a id="l%(c)d" href="#l%(c)d" class="linenr">%(c)4d</a> %(l)s\
+</div>
""" % {
'c': count,
'l': l
@@ -664,10 +669,10 @@
# one hash
ps = get_last_patches(1)
- print '<div class=title>&nbsp;</div>'
- print '<table cellspacing=0>'
+ print '<div class="title">&nbsp;</div>'
+ print '<table cellspacing="0">'
print ' <tr><td>description</td><td>%s</td></tr>' % config.repodesc
- print ' <tr><td>owner</td><td>%s</td></tr>' % owner
+ print ' <tr><td>owner</td><td>%s</td></tr>' % escape(owner)
print ' <tr><td>last change</td><td>%s</td></tr>' % \
ps[0].local_date_str
print ' <tr><td>url</td><td><a href="%(url)s">%(url)s</a></td></tr>' %\
@@ -684,7 +689,7 @@
p = get_patch(phash)
print """
<div>
- <a class=title href="%(myreponame)s;a=commit;h=%(hash)s">%(name)s</a>
+ <a class="title" href="%(myreponame)s;a=commit;h=%(hash)s">%(name)s</a>
</div>
""" % {
'myreponame': config.myreponame,
@@ -703,7 +708,7 @@
p = get_patch(phash)
print """
<div>
- <a class=title href="%(myreponame)s;a=commit;h=%(hash)s">
+ <a class="title" href="%(myreponame)s;a=commit;h=%(hash)s">
%(name)s --&gt; to head</a>
</div>
""" % {
@@ -724,7 +729,7 @@
dsrc = get_file_diff(phash, fname)
print """
<div>
- <a class=title href="%(myreponame)s;a=commit;h=%(hash)s">%(name)s</a>
+ <a class="title" href="%(myreponame)s;a=commit;h=%(hash)s">%(name)s</a>
</div>
<div class="page_path"><b>%(fname)s</b></div>
""" % {
@@ -745,7 +750,7 @@
dsrc = get_file_headdiff(phash, fname)
print """
<div>
- <a class=title href="%(myreponame)s;a=commit;h=%(hash)s">
+ <a class="title" href="%(myreponame)s;a=commit;h=%(hash)s">
%(name)s --&gt; to head</a>
</div>
<div class="page_path"><b>%(fname)s</b></div>
@@ -774,11 +779,11 @@
print """
<div>
- <a class=title href="%(myreponame)s;a=commitdiff;h=%(hash)s">%(name)s</a>
+ <a class="title" href="%(myreponame)s;a=commitdiff;h=%(hash)s">%(name)s</a>
</div>
-<div class=title_text>
-<table cellspacing=0>
+<div class="title_text">
+<table cellspacing="0">
<tr><td>author</td><td>%(author)s</td></tr>
<tr><td>local date</td><td>%(local_date)s</td></tr>
<tr><td>date</td><td>%(date)s</td></tr>
@@ -794,17 +799,17 @@
'name': p.name,
}
if p.comment:
- c = p.comment.replace('\n', '<br>')
- print '<div class=page_body>', c, '</div>'
+ c = p.comment.replace('\n', '<br/>')
+ print '<div class="page_body">', c, '</div>'
changed = p.adds + p.removes + p.modifies.keys() + p.moves.keys() + \
p.diradds + p.dirremoves
if changed or p.moves:
n = len(changed)
- print '<div class=list_head>%d file(s) changed:</div>' % n
+ print '<div class="list_head">%d file(s) changed:</div>' % n
- print '<table cellspacing=0>'
+ print '<table cellspacing="0">'
changed.sort()
alt = False
for f in changed:
@@ -823,7 +828,7 @@
if show_diff:
print """
<td>
- <a class=list href="%(myreponame)s;a=filediff;h=%(hash)s;f=%(file)s">
+ <a class="list" href="%(myreponame)s;a=filediff;h=%(hash)s;f=%(file)s">
%(file)s</a>
</td>
""" % {
@@ -867,9 +872,9 @@
if show_diff:
print """
-<td>
- <a class=link href="%(myreponame)s;a=filediff;h=%(hash)s;f=%(file)s">diff
-</td>
+<td><a class="link" href="%(myreponame)s;a=filediff;h=%(hash)s;f=%(file)s">
+ diff
+</a></td>
""" % {
'myreponame': config.myreponame,
'hash': p.hash,
@@ -886,7 +891,7 @@
# the head
print """
-<div><a class=title href="%s;a=tree">Current tree</a></div>
+<div><a class="title" href="%s;a=tree">Current tree</a></div>
<div class="page_path"><b>
""" % config.myreponame
@@ -934,8 +939,8 @@
if f in dlist:
print """
- <td><a class=list href="%(myrname)s;a=tree;f=%(newf)s">%(f)s</a></td>
- <td><a class=link href="%(myrname)s;a=tree;f=%(newf)s">tree</a></td>
+ <td><a class="list" href="%(myrname)s;a=tree;f=%(newf)s">%(f)s</a></td>
+ <td><a class="link" href="%(myrname)s;a=tree;f=%(newf)s">tree</a></td>
""" % {
'myrname': config.myreponame,
'f': f,
@@ -943,8 +948,8 @@
}
else:
print """
- <td><a class=list href="%(myrname)s;a=headblob;f=%(fullf)s">%(f)s</a></td>
- <td><a class=link href="%(myrname)s;a=headblob;f=%(fullf)s">headblob</a></td>
+ <td><a class="list" href="%(myrname)s;a=headblob;f=%(fullf)s">%(f)s</a></td>
+ <td><a class="link" href="%(myrname)s;a=headblob;f=%(fullf)s">headblob</a></td>
""" % {
'myrname': config.myreponame,
'f': f,
@@ -960,7 +965,7 @@
print_navbar(f = fname)
filepath = os.path.dirname(fname)
print """
- <div class=title><b>
+ <div class="title"><b>
"""
# and the linked, with links
@@ -1038,10 +1043,10 @@
'desc': escape(p.name),
}
print ' <content:encoded><![CDATA['
- print escape(p.name) + '<br>'
+ print escape(p.name) + '<br/>'
if p.comment:
- print '<br>'
- print escape(p.comment).replace('\n', '<br>\n')
+ print '<br/>'
+ print escape(p.comment).replace('\n', '<br/>\n')
print ']]>'
print '</content:encoded></item>'
@@ -1069,21 +1074,21 @@
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<meta name="robots" content="index, nofollow"/>
<title>darcs - Repositories</title>
-<link rel="stylesheet" type="text/css" href="%(css)s">
-<link rel="shortcut icon" href="%(fav)s">
-<link rel="icon" href="%(fav)s">
+<link rel="stylesheet" type="text/css" href="%(css)s"/>
+<link rel="shortcut icon" href="%(fav)s"/>
+<link rel="icon" href="%(fav)s"/>
</head>
<body>
<div class="page_header">
-<a href=http://darcs.net title="darcs">
-<img src="%(logo)s" alt="darcs logo" style="float:right; border-width:0px;">
+<a href="http://darcs.net" title="darcs">
+<img src="%(logo)s" alt="darcs logo" style="float:right; border-width:0px;"/>
</a>
<a href="%(myname)s">repos</a> / index
</div>
<div class="index_include">
-This is the repository index for a darcsweb site.<br>
-These are all the available repositories.<br>
+This is the repository index for a darcsweb site.<br/>
+These are all the available repositories.<br/>
</div>
<table cellspacing="0">
<tr>
@@ -1113,12 +1118,12 @@
else: print '<tr class="light">'
alt = not alt
print """
-<td><a class=list href=%(myname)s?r=%(name)s;a=summary>%(name)s</a></td>
+<td><a class="list" href="%(myname)s?r=%(name)s;a=summary">%(name)s</a></td>
<td>%(desc)s</td>
-<td class=link><a href=%(myname)s?r=%(name)s;a=summary>summary</a> |
-<a href=%(myname)s?r=%(name)s;a=shortlog>shortlog</a> |
-<a href=%(myname)s?r=%(name)s;a=log>log</a> |
-<a href=%(myname)s?r=%(name)s;a=tree>tree</a>
+<td class="link"><a href="%(myname)s?r=%(name)s;a=summary">summary</a> |
+<a href="%(myname)s?r=%(name)s;a=shortlog">shortlog</a> |
+<a href="%(myname)s?r=%(name)s;a=log">log</a> |
+<a href="%(myname)s?r=%(name)s;a=tree">tree</a>
</td>
</tr>
""" % {