Ticket 1134 and getTiddlerText inconsistencies.

7 views
Skip to first unread message

JohnH

unread,
Feb 15, 2011, 4:39:05 AM2/15/11
to TiddlyWikiDev, tiddl...@tiddlytools.com
Hi, I have joined this group at the request of Eric Shulman of
TiddlyTools. I have been doing some development on TiddlyWiki and was
complaining about the inconsistent behaviour of the replacement for
'getTiddlerText' in his CoreTweaks plugin. Eric's 'defence' for this
was that he did not want to change the behaviour beyond the scope of
the relevant ticket 1134 and the inconsistency I was complaining about
was in the original Core function.

My main complaint is that if a Tiddler or a Section is absent, the
function returns either the defaultText parameter, or if that is
missing NULL. In contrast, if a Slice is absent, the function returns
the entire text of the Tiddler disregarding any defaultText. The Slice
behaviour makes no sense to me and I think it is just simply a bug.
Fixing it is straight forward, particularly in Eric's re-written code,
but it obviously risks breaking existing code.

It is worth noting that the ticket 1134 does not seem to reflect the
full scope of Eric's implementation either since the ticket talks only
of white space handling in Section specifications. As I understand it,
Eric has also implemented fallback to the prototype if a Section is
missing in a Shadow Tiddler. As far as I can see, he has not done the
same for Slices. I have not formed an opinion on whether this fallback
is desirable, but I will certainly argue that the behaviour should be
consistent between Slices and Sections.

Also, the code could do with some refactoring so there would be a
'getTiddlerSection' to match 'getTiddlerSlice'.

Please go easy on me if I have misunderstood something as I am quite
new to TiddlyWiKi and to JavaScript.
Reply all
Reply to author
Forward
0 new messages