From d923259fae9fb323ec876e2b6ff2701149195236 Mon Sep 17 00:00:00 2001 From: David Robillard <d@drobilla.net> Date: Sun, 24 Mar 2019 19:10:05 +0100 Subject: Fix invalid HTML when specification index is empty --- lv2specgen/lv2specgen.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'lv2specgen') 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: -- cgit v1.2.1