Allow other WikiNames

For my purposes, I wanted WikiNames to include the following formats: ThisIsAName (instead of ThisIsaName) and Lawrence2005 (for linking to my BibTeX-keyed pages). A small modifcation to MoinMoin/parser/wiki.py does the trick:

   1     word_rule = ur'(?:(?<![%(l)s])|^)%(parent)s(?:%(subpages)s((?:[%(u)s]+[%(l)s]+){2,})|(?:[%(u)s]+[%(l)s]+[%(d)s]+))+(?![%(u)s%(l)s]+)' % {
   2         'u': config.chars_upper,
   3         'l': config.chars_lower,
   4         'd': config.chars_digits,
   5         'subpages': config.allow_subpages and (wikiutil.CHILD_PREFIX + '?') or '',
   6         'parent': config.allow_subpages and (ur'(?:%s)?' % re.escape(PARENT_PREFIX)) or '',
   7     }

Or, as a patch

40,41c40
< #    word_rule = ur'(?:(?<![%(l)s])|^)%(parent)s(?:%(subpages)s(?:[%(u)s][%(l)s]+){2,})+(?![%(u)s%(l)s]+)' % {  # original re
<     word_rule = ur'(?:(?<![%(l)s])|^)%(parent)s(?:%(subpages)s((?:[%(u)s]+[%(l)s]+){2,})|(?:[%(u)s]+[%(l)s]+[%(d)s]+))+(?![%(u)s%(l)s]+)' % {
---
>     word_rule = ur'(?:(?<![%(l)s])|^)%(parent)s(?:%(subpages)s(?:[%(u)s][%(l)s]+){2,})+(?![%(u)s%(l)s]+)' % {
44d42
<         'd': config.chars_digits,

MoinMoin: JamieLawrence/OtherWikiNames (last edited 2007-10-29 19:17:24 by localhost)