diff --git a/Docs/src/bin/halibut/bk_xhtml.c b/Docs/src/bin/halibut/bk_xhtml.c
index fe85269c..114ff4fb 100644
--- a/Docs/src/bin/halibut/bk_xhtml.c
+++ b/Docs/src/bin/halibut/bk_xhtml.c
@@ -1245,18 +1245,18 @@ xhtml_add_contents_entry(FILE * fp, xhtmlsection * section, int limit)
if(chm_toc)fprintf(chm_toc, "
\n");
}
filename = conf.leaf_level ? section->file->filename : "";
- fragment = xhtml_get_fragmentname(section, fragmentbuf);
+ fragment = "";
+ if (section->para->type != para_Chapter || !conf.leaf_level)
+ fragment = xhtml_get_fragmentname(section, fragmentbuf);
+
fprintf(fp, "- ");
fprintf(fp, "",
(section->para->type == para_Chapter|| section->para->type == para_Appendix) ? "class=\"btitle\" " : "",
- filename,
- (section->para->type == para_Chapter) ? "" : fragment);
+ filename, fragment);
if(chm_toc)fprintf(chm_toc, "