I don't know if this is a bug or a feature, but the prepend filter doesn't
check to see if what's pre-pending is unique or not.
There's an undocumented filter, unique, which you can use to pack the list.
e.g.
+[prepend[This is a test]unique[]]
This will give you the results you expected (I think).
The question is, should the prepend (and probably the other '-pend'
operators) check for dupes, or is this a 'feature' that could be useful in
some situations?
Have fun,
Mark
On Monday, September 11, 2017 at 9:12:31 AM UTC-7, c pa wrote:
>
>
>
> *Overview*I am testing standard tiddlywiki operators and came up with the
> following odd behavior:
>
> *Description*
> Using +[prepend[This is a test]] as a subfilter to action-listops will
> prepend the string twice (but not 3 times) if executed three times in a row
>
> *Code Example*
> Tiddler = action-listops-test4
> <br/>
> Field Value: {{action-listops-test4!!fieldlist}}
>
> <$button>Set Up Test
> <$action-setfield $tiddler="action-listops-test4" $field="fieldlist"
> $index="" $value="one [[and a two]] [[and three]] four" />
> </$button>
> <$button>Execute test
> <$action-listops $tiddler="action-listops-test4" $field="fieldlist"
> $index="" filter="" $subfilter="+[prepend[This is a test]]" $tags="" />
> </$button>
>
> *Expected behavior*
> *Set up Test*
> Field Value = "one [[and a two]] [[and three]] four"
> *Execute Test*
> Field Value = "This is a test one [[and a two]] [[and three]] four"
> *Execute Test*
> Field Value = "This is a test one [[and a two]] [[and three]] four"
> *Execute Test*
> Field Value = "This is a test one [[and a two]] [[and three]] four"
>
> *Actual behavior*
> *Set up Test*
> Field Value = "one [[and a two]] [[and three]] four"
> *Execute Test*
> Field Value = "This is a test one [[and a two]] [[and three]] four"
> *Execute Test*
> Field Value = "This is a test This is a test one [[and a two]] [[and
> three]] four"
> *Execute Test*
> Field Value = "This is a test This is a test one [[and a two]] [[and
> three]] four"
>
>
>
--
You received this message because you are subscribed to the Google Groups
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/49a29df4-e477-44e8-bb7f-6f516b2429e5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.