summaryrefslogtreecommitdiff
path: root/cli/context.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'cli/context.cxx')
-rw-r--r--cli/context.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/cli/context.cxx b/cli/context.cxx
index b923c4b..cd5d88c 100644
--- a/cli/context.cxx
+++ b/cli/context.cxx
@@ -1696,6 +1696,14 @@ format (semantics::scope& scope, string const& s, bool para)
{
char t (ph[0]);
+ if (pi.empty ())
+ {
+ cerr << "error: TOC heading '" << pv << "' has no id" << endl;
+ throw generation_failed ();
+ }
+
+ pv = "<a href=\"#" + pi + "\">" + pv + "</a>";
+
// Unwind heading levels that are deeper ("more sub") than us.
//
for (; tocs.size () != 1; tocs.pop_back ())