For those who have been following my efforts with mod- fields, this is the next chapter - thanks for all the help so far!
Currently, ModifierBlockMacro contains:
\define innermodifierblock(for:"")
$for$
<$set name="x" value=<<__for__>> >
<$set name="mfield" filter="[title<x>lowercase[]split[ ]join[_]addprefix[mod-]]">
<$list filter="[all[tiddlers]has<mfield>]">
<tr><th><$link/></th><td><<x>></td><td><$view field=<<mfield>> /></td></tr>
<<innermodifierblock <<currentTiddler>>
</$list>
</$set>
</$set>
\end
\define ModifierBlock(for:"")
<table>
<<innermodifierblock $for$>>
</table>
\end
Tiddler ModifierBlockTest contains <<ModifierBlock test>> and has no fields.
Tiddler InheritModTest contains no text but has field mod-test: Level1.
Tiddler InheritModTest1 contains no text but has field mod-inheritmodtest: Level 2.
So what should happen is:
<<innermodifierblock test>> runs
It adds InheritModTest to the list because of its mod-test
<<innermodifierblock inheritmodtest>> runs
It adds InheritModTest1 to the list because of its mod-inheritmodtest
<<innermodifierblock inheritmodtest1>> runs
It adds nothing to the list because there is no mod-inheretmodtest1 anywhere
<<innermodifierblock inheritmodtest1>> ends
<<innermodifierblock inheritmodtest>> ends
<<innermodifierblock test>> ends
What actually happens is that TiddlyWiki crashes with an infinite recursion error, constantly repeating the first line of the list with "InheritModTest - test - level1" on it, followed by "InheritModTest" as it indicates the start of the new loop. It seems that it is confusing the two $list s running in different recursive scopes. Is there any way around this?