I'm thinking that one of the major problems with the way ZWiki handles WikiName is the reliance on 'b' in the regular expressions. If there was a convenient way of saying, "the empty string at the beginning of a word but for whitespace only", we'd be able to drop that in and all of those problems with WikiName happening to be in the attribute of some HTML tag somewhere (usually <tt>&lt;a&nbsp;href="[WikiName]"&gt;Something&lt;/a&gt;</tt>) would disappear. Well, at least some of them would.

So, I'm pondering going all slow and procedural on the rendering, pulling all that nice fast re.sub() stuff out and replacing it with something that patiently wades through the text an element at a time trying to make sense of it. And, in doing so, hopefully I'll also be able to pull a few tricks like only linking from the first occurrence of a WikiName on a page. We'll see how it goes.

If that turns out to be mind-boggingly slow, if we fix the code that deals with parenting and backlinks (I'm thinking an external dictionary that we can put some decent locking on to avoid ZCatalog update conflicts) I can do things like explicitly dirty pages that need to be re-rendered. That, in turn, would enable some decent last-modified handling. Which would be nice.