From 3d7b40fbaaccb516b215e0253407f581b2239fca Mon Sep 17 00:00:00 2001 From: Jermolene Date: Sun, 2 Nov 2014 21:03:27 +0000 Subject: [PATCH] Fix problem with recursion in table of contents macro Fixes #1036 --- core/wiki/macros/toc.tid | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/core/wiki/macros/toc.tid b/core/wiki/macros/toc.tid index 982eb37b8..86dcedc44 100644 --- a/core/wiki/macros/toc.tid +++ b/core/wiki/macros/toc.tid @@ -1,21 +1,31 @@ title: $:/core/macros/toc tags: $:/tags/Macro -\define toc(tag,sort:"") +\define toc-body(rootTag,tag,sort:"")
    -<$list filter="[tag[$tag$]$sort$]"> +<$list filter="""[tag[$tag$]$sort$]""">
  1. <$list filter="[is[current]toc-link[no]]" emptyMessage="<$link><$view field='caption'><$view field='title'/>"> <$view field="caption"> <$view field="title"/> -<$macrocall $name="toc" tag=<> sort="$sort$"/> + +<$list filter="""[all[current]] -[[$rootTag$]]"""> + +<$macrocall $name="toc-body" rootTag="""$rootTag$""" tag=<> sort="$sort$"/> + + +
\end +\define toc(tag,sort:"") +<> +\end + \define toc-linked-expandable-body(tag,sort:"") <$set name="toc-state" value=<>>