I just came across two apparent limitations regarding tiddler slices.
My data looked like this:
|!ID|200712220001|
|!Last Name|Doe|
|!First Name|John|
I expected the following code to return the respective slice's value:
store.getTiddlerSlice(title, "ID");
store.getTiddlerSlice(title, "Last Name");
store.getTiddlerSlice(title, "First Name");
However, this didn't work (returned "undefined").
There seem to be two reasons for that:
1. table row headings
Unlike bold and italic formatting, the "!" indicating a row heading
seems not to be ignored.
2. spaces in labels
It appears that a slice's label must not contain spaces.
So I had to resort to using much less appealing formatting instead:
''ID'': 200712220001
''~LastName'': Doe
''~FirstName'': John
Are these limitations known or even intentional, or should I create a
ticket for this? (I don't dare touching the slicesRE though... )
-- F.
Thanks, Lyall.
I know about your ImprovedSlicesPlugin - and while there's certainly a
raison d'être for it as a plugin*, I believe that the core slices should
remain simple label/value pairs.
Nevertheless, the core RegEx could do with some improvements, and your
ticket (http://trac.tiddlywiki.org/ticket/370) certainly deserves some
attention.
If you could submit a patch, that would make it much easier for Jeremy
or Martin to review the suggested changes and consider them for
inclusion in the core.
-- F.
* I would have called it ExtendedSlicesPlugin
An actual patch would greatly enhance the chances of this being given
another look (which is only natural; the easier you make it for the
maintainers, the quicker they can review and possibly commit the changes).
-- F.