summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-02-11 08:44:34 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-02-11 08:44:34 +0200
commit26a99d68971351198c58e5980d07804d8153bfaf (patch)
tree69d82ae5aa3d492547beed5c91d5c5fa7dfd6ea4
parent4d02432c918d9ce431bf6c3e3d2b7410093dfbb5 (diff)
Remove empty <th> from preface TOC entries
-rw-r--r--cli/context.cxx13
-rw-r--r--tests/toc/toc.html6
2 files changed, 12 insertions, 7 deletions
diff --git a/cli/context.cxx b/cli/context.cxx
index 1b98322..711086b 100644
--- a/cli/context.cxx
+++ b/cli/context.cxx
@@ -1800,12 +1800,17 @@ format (semantics::scope& scope, string const& s, bool para)
}
}
- // Save the heading number for later.
- //
+ v += in + "<tr>";
+
if (!n.empty ())
- heading_map[pi] = n;
+ {
+ v += "<th>" + n + "</th><td>";
+ heading_map[pi] = n; // Save it for later.
+ }
+ else
+ v += "<td colspan=\"2\">";
- v += in + "<tr><th>" + n + "</th><td>" + pv; // No newline
+ v += pv; // No newline
tocs.push_back (toc_entry (t));
break;
}
diff --git a/tests/toc/toc.html b/tests/toc/toc.html
index 2874edc..5305db9 100644
--- a/tests/toc/toc.html
+++ b/tests/toc/toc.html
@@ -1,11 +1,11 @@
<h1>Table of Contents</h1>
<table class="toc">
- <tr><th></th><td><a href="#preface">Preface</a>
+ <tr><td colspan="2"><a href="#preface">Preface</a>
<table class="toc">
- <tr><th></th><td><a href="#about-document">About This
+ <tr><td colspan="2"><a href="#about-document">About This
Document</a></td></tr>
- <tr><th></th><td><a href="#more-information">More Information</a></td></tr>
+ <tr><td colspan="2"><a href="#more-information">More Information</a></td></tr>
</table>
</td></tr>
<tr><th colspan="2"><a href="#part1">PART I</a></th></tr>