Lists within tiddlers with ! in the name

Hello folks, I started typing this as a question, and while testing further I found a work-around, but decided to post anyways just for future me and others who might search for this down the road.

I’m stumbled across this issue in some random testing for a project I’m working on. Essentially I’m storing a list (in the regular list field) of a tiddler. I don’t have control on the tiddler name (hence my other post about tiddler names with spaces). I finally overcame that and happened to test the tiddler name This tiddler is the greatest!!! and everything broke. After some research and isolation, it seems like !! is going to be a problem title, especially for list operations.

For example:
<$list filter="[list[This tiddler is the greatest!]]"></$list> works fine
<$list filter="list[This tiddler is the greatest!!]]"></$list> does NOT work

I believe this is due to the ability to use !! as a field grabbing mechanism, like {{mytitle!!text}}. I’ve also tried storing the title in a variable to see if that helped like:

\define mytitle() This tiddler is the greatest!!!

<$list filter="[list<mytitle>]">

</$list>

which still doesn’t work.

What does work though seems to be this:
[[This tiddler is the greatest!!!]get[list]enlist-input[]]

I guess the only interest I might have is that it would seem that for all the other “solutions” and plugins that do stuff with titles - everyone must have this same concern, and that the pattern I described above get[list]enlist-input[] must actually be the standard (and not [list[...]) behind the scenes to not be susceptible to this.

1 Like

@stobot thanks for sharing this. I suspect this could be patched so when “!!” is encountered at the end of a title it is not considered a text reference. With field names themselves having less naming restrictions versions of this may also occur in field handling.

I am not sure what you expect from the list operator. It says ;

The parameter for the list operator is a reference to a field or property of a particular tiddler

However you are passing a title, which looks like a reference.

Can you share the balance of tiddlers to test this on tiddlywiki.com?. Personally I think this can be overcome with appropriate delimits.

Hi @stobot as you guessed, the problem is that the list[] operator takes a “text reference” as an operand, and not a tiddler title. That means that it is impossible to use titles that contain double exclamation marks or hashes (ie !! or ##).

A workaround is to use the enlist-input operator like this:

[[This tiddler is the greatest!!]get[list]enlist-input[]]
1 Like

Right. This is a very interesting issue merely because users like @stobot are pushing bounds that great work before can (occasionally) fail on. The fact that there are operators like the enlist-input that can solve that problem is testament to anticipated solutions already.

Just a comment
TT