I've jaust added the ticket:
http://trac.tiddlywiki.org/tiddlywiki/ticket/234
In order to reproduce this defect please perform the following steps:
* Open a TiddlyWiki file
* Edit an arbitrary tiddler
* Add "[[]]" to the tags (without the double quotes)
* Close the tiddler by clicking 'done'
The result is:
1. Saving the TiddlyWiki file is not possible because of a null object
2. Editing the tags section of the defective tiddler is not possible
as the <<edit>> macro fails there
3. The "Tags" tab doesn't show any tags as the <<allTags>> macro fails
I've recommended 'low' severity because
* adding the mentioned faulty 'taggly tag' will happen only erroneously
* everything is ok after deleting the defective tiddler or reloading
TiddlyWiki
* data loss can be avoided when copying possible changes in the tiddler
text first
Therefore this might also be 'trivial'. But TiddlyWiki should be stable
in this case.
Notes:
When adding mentioned faulty 'taggly tag' with double quotes you can
reach this situation by first choosing 'done' and then again choosing
'edit' as TiddlyWiki removes the double quotes in the tags section of a
tiddler.
I've tested this in TiddlyWiki version 2.1.3 which was currently not
choosable in the "Version" field of this ticket. So I left the version
field empty. Can you please add this version to the list?
Best regards
Georg
I've noticed something more, but I'm not sure wether this is a (very
very trivial) defect or just an illegal usage. Hence I'm describing it
here first instead of adding it as new ticket.
Again please perform the following steps to reproduce this:
1. Create a new tiddler
2. Change the title to "[[This is a title]]" (without double quotes)
3. Save the tiddler
4. Create another tiddler
5. Add "[[This is a title]]" (without double quotes) to the tags
section
6. Click 'done'
Everything is ok. TiddlyWiki recognizes the tag as taggly tag. The tags
list of this tiddler shows:
This is a tilte
7. Now again edit the latter tiddler
8. Change the added tag to "[[This is a title]]" ... but now *with*
double quotes
9. Click 'done'
I don't know if this is legal and the result is expected but TiddlyWiki
now correctly shows the following taggly tag within the tags section:
[[This is a title]]
This is recognized as taggly tag and you can open the tiddler with the
corresponding title.
10. Edit the tiddler again
You will now see that the tags section shows the following entry:
[[[[This is a title]]]]
Also here everything is as expected (if this is legal).
But now:
11. Click 'done' again (without having changed anything)
Now the formerly correct taggly tag is broken. The tags list of the
tiddler shows:
[[This is a tittle
]]
And when you open the tiddler for editing again you can see that
TiddlyWiki has added a space:
[[[[This is a tittly]] ]]
Of course the same happens if some uses single quotes instead of double
quotes when initially adding the taggly tag: '[[This is a tittle]]'
(with single quotes).
Please forgive me having reported something like that. It's really a
little bit stupid and very very trivial. But the handling of this
scenario seems to be a little bit incosistent to me. Of course - as I
mentioned: I currently don't know if this is just an illegal input at
all. And if not ... noone will care about this I guess.
Anyway. Nevertheless I thought I should tell you, what I've seen. ;-)
Best regards
Georg
Cheers
Jeremy
--
Jeremy Ruston
mailto:jer...@osmosoft.com
http://www.tiddlywiki.com
It is much easier to forbid the usage of some problematic characters
than trying to handle all known and / or currently unknown cases. I
could really live with this.
But where to start and where to end?
Additionally I think you can't forbid the usage of "[" and "]" within
tags. Otherwise you would break taggly tagging. Any other character
would produce the same problem. You could resolve this only if tags are
not space but (e.g.) comma separated (by disabling commas in titles
what currently is possible) ... I can remember of some discussions on
this once upon a time ;-)
Regarding the [[]] problem in tags this is only a missing check against
null I guess. But you can forbid the usage of "[" and "]" within
titles. This is correct and a acceptable solution.
Here another question arise: What about backward compatibility? In fact
this may not be such a problem regarding this issue. But who really
knows?
In case of preceding or trailing spaces in titles TiddlyWiki could just
remove them automatically and output a corresponding message if
possible. Here some must think about taggly tag entries like the
following:
[[ This is a taggly tag ]]
Should the spaces of this taggly tag also be removed or should this be
forbidden? Whatever it will be done I think that the handling should be
the same as with the titles ...
Hm ... just some thoughts.
regards
Georg
Oh, and of course "::" is now not valid within a tiddler title,
because of the tiddler slice syntax.
Cheers
Jeremy
After having tested some more situations in connection with my current
cooker adjustments (trying to eliminate all errors before providing my
current solution very soon for download) I thought about removing
single and double quotes from tags beeing specified in the recipe file
as arguments to the tiddler directive (in order to easely modify the
existing metadata).
I saw that tiddlywiki is automatically removing quotes if they are
added like "aTag" or 'anotherTag'.
But as soon as you type two (or more) consecutive quotes like "" or ''
with whatever combinations you break the tiddler with exactly the same
results as described in case of [[]].
After knowing this I think there should be a list of forbidden things
you're not allowed to do in tiddler titles as well as within the tags
section. Regardless of the question if tiddlywiki throws an error or
not the tiddlywiki distribution should include a small description
about forbidden, invalid and / or dangerous characters to be used in
the title and/or tags section. Even if not many are using such
characters I guess, during testing my current cooker version against
some downloaded tiddlywiki files I've seen a lot. Even tiddlers with
just the following title: "~" ... which correctly is not a problem.
By the way: in case of quotes within taggly tags (like: [["""taglly
tag"""]]) everything is working fine. They are not removed and don't
break anything.
As taggly tagging will be not supported in the current modified cooker
version (needs some more investigation) I'm going to automatically
remove any type of qoutes before adding the specified additional tags
until it is clear if tiddlywiki implements some escaping of special
characters in titles and tags.
Cheers
Georg
But I've implemented a litle bit different logic: every occurence of
consecutive qoutes will be removed with only one of them, so tiddlywiki
can handle them correctly and thins like "Mc'Bath" remain possible.
So I tested this completely arbitrary line added through cook process
into an existing tiddler:
This " is' a '' ""line with '''qoutes"""
After cooking process it was
This " is' a ' 'line with 'qoutes'
Then I added this result into the tags section of a tiddler in order to
see how tiddlywiki handles this.
And the result (after 'done' and 'edit') was:
This is' a [[ ]] line with qoutes
Creating a tiddly tag with a space. Funny :-)
This is a abyss. Impossible to think of all scenarios. Don't care for
it. ;-)
regards
Georg
P.S.: I'm definitely stopping here!
I think that it slowly reaches my mind and I maybe understand somehow
what you could have ment with switching from my "can't cope as tag" to
"forbid in title". Regardless of the fact that I agree ... the
following small quote just for clarification either from my side:
"The problem with engineers is that they tend to cheat in order to get
results.
The problem with mathematicians is that they tend to work on toy
problems in order to get results.
The problem with program verifiers is that they tend to cheat at toy
problems in order to get results."
[Fortune]
;-)
I *am* a program verifier in my "real" company life. Among other things
I'm sitting night and day at my desc and rack my brain how I could
break programs after the normal use case stuff is running. Don't ask
how kinky some must be to take much pleasure in that ... but I really
enjoy it ;-) This can be very interesting also including much test
automation programming when having complex plattforms and APIs in front
of your own. But the basic questions remain: What ideas can users have?
What errors could they make? What else may happen? How stable is the
program against these scenarios? ... Just try it out! ... And as soon
as I gather momentum there is no stopping. (... Well, yes ... of course
this happens normally in a little bit more "structured" way ;-) The
result allways is a fix or just better documentation. Both enhances the
quality of a product of course.
This does not mean that I'm writing code without defects. And this also
does not mean that I'm going to introduce myself as quality engineer of
tiddlywiki. But this is the way I'm thinking!
I've never intended to add [[]] into titles of my own tiddlywiki files
in order to reference this as taggly tag. I in fact I can't see any
sence in doing so! :-))))
I'm just cheating at toy problems.
Cheers
Georg