Permalink
Browse files

Merge pull request #93 from gregleaver/issue62

TOC should only show link name, fixes #62.
  • Loading branch information...
2 parents 3361ebc + 76a86ff commit 975df6267cbc798ecfcb6948364cd978dc2bf36f @vmg vmg committed Mar 3, 2012
Showing with 9 additions and 1 deletion.
  1. +9 −1 html/html.c
View
10 html/html.c
@@ -513,6 +513,14 @@ toc_header(struct buf *ob, const struct buf *text, int level, void *opaque)
BUFPUTSL(ob, "</a>\n");
}
+static int
+toc_link(struct buf *ob, const struct buf *link, const struct buf *title, const struct buf *content, void *opaque)
+{
+ if (content && content->size)
+ bufput(ob, content->data, content->size);
+ return 1;
+}
+
static void
toc_finalize(struct buf *ob, void *opaque)
{
@@ -546,7 +554,7 @@ sdhtml_toc_renderer(struct sd_callbacks *callbacks, struct html_renderopt *optio
rndr_emphasis,
NULL,
NULL,
- NULL,
+ toc_link,
NULL,
rndr_triple_emphasis,
rndr_strikethrough,

0 comments on commit 975df62

Please sign in to comment.