aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2019-03-24 19:10:05 +0100
committerDavid Robillard <d@drobilla.net>2019-03-24 21:23:02 +0100
commitd923259fae9fb323ec876e2b6ff2701149195236 (patch)
tree3ac5b0e838588c09bba5350f43300cea6decac31
parentd7c652ebab7ef5fa91d89f4b511bd4c8120d5fd7 (diff)
downloadlv2-d923259fae9fb323ec876e2b6ff2701149195236.tar.xz
Fix invalid HTML when specification index is empty
-rwxr-xr-xlv2specgen/lv2specgen.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/lv2specgen/lv2specgen.py b/lv2specgen/lv2specgen.py
index a6f30db..94af967 100755
--- a/lv2specgen/lv2specgen.py
+++ b/lv2specgen/lv2specgen.py
@@ -741,8 +741,8 @@ def buildIndex(m, classlist, proplist, instalist=None, filelist=None):
if not (classlist or proplist or instalist or filelist):
return ''
- head = '<tr>'
- body = '<tr>'
+ head = ''
+ body = ''
def termLink(m, t):
if str(t).startswith(spec_ns_str):
@@ -819,10 +819,13 @@ def buildIndex(m, classlist, proplist, instalist=None, filelist=None):
body += '<li><a href="%s">%s</a></li>' % (i, os.path.basename(i))
body += '</ul></td>\n'
- head += '</tr>'
- body += '</tr>'
- return '<table class="index"><thead>%s</thead>\n<tbody>%s</tbody></table>' % (head, body)
+ if head and body:
+ return '''<table class="index">
+<thead><tr>%s</tr></thead>
+<tbody><tr>%s</tr></tbody></table>
+''' % (head, body)
+ return ''
def add(where, key, value):
if not key in where: