From 0c3e549235913b94855424aadadfd18ca07b3746 Mon Sep 17 00:00:00 2001 From: Jermolene Date: Thu, 5 Apr 2018 16:32:35 +0100 Subject: [PATCH] Fix TOC recursion detection We need to explicitly guard against tiddlers tagged with themselves. --- core/wiki/macros/toc.tid | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/wiki/macros/toc.tid b/core/wiki/macros/toc.tid index 477e0385e..23d55b5f5 100644 --- a/core/wiki/macros/toc.tid +++ b/core/wiki/macros/toc.tid @@ -11,7 +11,7 @@ tags: $:/tags/Macro \define toc-body(tag,sort:"",itemClassFilter,exclude,path)
    - <$list filter="""[all[shadows+tiddlers]tag[$tag$]!has[draft.of]$sort$] $exclude$"""> + <$list filter="""[all[shadows+tiddlers]tag[$tag$]!has[draft.of]$sort$] -[[$tag$]] $exclude$"""> <$vars item=<> path="""$path$/$tag$""" excluded="""$exclude$ -[[$tag$]]"""> <$set name="toc-item-class" filter="""$itemClassFilter$""" emptyValue="toc-item" value="toc-item-selected">
  1. >> @@ -88,7 +88,7 @@ tags: $:/tags/Macro \define toc-expandable(tag,sort:"",itemClassFilter:" ",exclude,path) <$vars tag="""$tag$""" sort="""$sort$""" itemClassFilter="""$itemClassFilter$""" excluded="""$exclude$ -[[$tag$]]""" path="""$path$/$tag$""">
      - <$list filter="""[all[shadows+tiddlers]tag[$tag$]!has[draft.of]$sort$] $exclude$"""> + <$list filter="""[all[shadows+tiddlers]tag[$tag$]!has[draft.of]$sort$] -[[$tag$]] $exclude$"""> <$list filter="[all[current]toc-link[no]]" emptyMessage=<> > <$macrocall $name="toc-unlinked-expandable-body" tag="""$tag$""" sort="""$sort$""" itemClassFilter="""itemClassFilter""" exclude=<> path=<> /> @@ -157,7 +157,7 @@ tags: $:/tags/Macro \define toc-selective-expandable(tag,sort:"",itemClassFilter,exclude,path) <$vars tag="""$tag$""" sort="""$sort$""" itemClassFilter="""$itemClassFilter$""" excluded="""$exclude$ -[[$tag$]]""" path="""$path$/$tag$""">
        - <$list filter="""[all[shadows+tiddlers]tag[$tag$]!has[draft.of]$sort$] $exclude$"""> + <$list filter="""[all[shadows+tiddlers]tag[$tag$]!has[draft.of]$sort$] -[[$tag$]] $exclude$"""> <$list filter="[all[current]toc-link[no]]" variable="ignore" emptyMessage=<> > <$macrocall $name=toc-unlinked-selective-expandable-body tag="""$tag$""" sort="""$sort$""" itemClassFilter="""$itemClassFilter$""" exclude=<> path=<> >