Minor error updating links[] in Tiddler.prototype.changed function

1 view
Skip to first unread message

Martin Budden

unread,
May 17, 2006, 4:29:02 PM5/17/06
to TiddlyWikiDev
Jeremy

There's a minor error in matching WikiLinks in this function: WikiLinks
must begin with a capital letter, in the "wikiLink" config.formatters
there is a prematch check to ensure that (say) aNewWikiLink is not
matched. However there is no corresponding check in
Tiddler.prototype.changed. This means if you create a tiddler which
includes the text "aNewWikiLink" then (correctly) a wikiLink will not
be created. However the Tiddler.prototype.changed function will match
on "NewWikiLink" and won't do a pre-match check. This means
"NewWikiLink" (without the "a") will be added to the links[] array and
so will turn up in the Missing Tiddlers tab.

I have two different fixes for this. The one I'd like to submit
involves removing the

"(?:" + config.textPrimitives.unWikiLink + "{0,1})"

prefix from config.textPrimitives.wikiLink. It is unnecessary since a
prematch check is required: I'd like to combine the check for the
unWikiLink with the prematch check.

Are you happy with this approach?

Martin

Jeremy Ruston

unread,
May 18, 2006, 8:38:24 AM5/18/06
to Tiddly...@googlegroups.com
Excellent catch, Martin, thanks. I agree with your approach of
combining the unWikiLink check with the prematch check.

I've created a bug ticket for this:

http://trac.tiddlywiki.org/tiddlywiki/ticket/35

Cheers

Jeremy.


--
Jeremy Ruston
mailto:jer...@osmosoft.com
http://www.tiddlywiki.com

Reply all
Reply to author
Forward
0 new messages