From 65b74b9a1d54f524426a15128b2b599906f1e9a0 Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Fri, 8 Mar 2013 16:38:45 -0500 Subject: [PATCH] Fix bug #8580: Do not include material in the XHTML TOC that is not also included in the output. --- src/insets/InsetTOC.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/insets/InsetTOC.cpp b/src/insets/InsetTOC.cpp index 1d8a05495f..08d77bb328 100644 --- a/src/insets/InsetTOC.cpp +++ b/src/insets/InsetTOC.cpp @@ -159,6 +159,11 @@ docstring InsetTOC::xhtml(XHTMLStream &, OutputParams const & op) const Toc::const_iterator const en = toc.end(); int lastdepth = 0; for (; it != en; ++it) { + // do not output entries that are not actually included in the output, + // e.g., stuff in non-active branches or notes or whatever. + if (!it->isOutput()) + continue; + // First, we need to manage increases and decreases of depth int const depth = it->depth(); -- 2.39.5