> Also, I find myself quite unable to understand where in the process
> the wikifier is triggered matching the text against any formatters. I
> keep running circles from displayTiddler, over refreshTiddler, some
> awkward getRecursiveTiddlerText chucking stuff into some innerHTML and
> back to square 1 ...but I can't figure out how this whole procees
> works.
Yeah, I had a similar reaction when creating twikifier[1] and
eventually gave up trying to understand the thing and just built up
everything around it that it demanded. The result is a bunch of messy
spaghetti that I don't understand...
From my experiments with tw5ikifier[2] I can say that the TiddlyWiki5
code is somewhat more graspable.
Sorry you're not getting a more helpful answer...
[1] http://github.com/cdent/twikifier
[2] https://github.com/cdent/tw5ikifier
--
Chris Dent http://burningchrome.com/
[...]
I believe (though I could be wrong), that the wikifier is triggered in
the view macro[1]. I believe the formatters are triggered in the
SubWikifyTerm function[2].
Basically, the wikifier is called, sometimes recursively, and at each
step the formatters directly add stuff to the DOM element passed in
while any matching regexp consumes some text (if that text needs
wikifying, then it is passed into SubWikify (the recursive bit), which
starts the process over again on the small subset of text). When there
is no more text left to wikify, it's done.
Ben
[1] https://github.com/TiddlyWiki/tiddlywiki/blob/master/js/Macros.js#L449
[2] https://github.com/TiddlyWiki/tiddlywiki/blob/master/js/Wikifier.js#L145