For a project I'm working on we need to restrict WikiNames to be
valid XML Names [1]. In a previous discussion Janne suggested that
the way to alter the default set of characters permitted in WikiNames
to prohibit white space was to modify a variable in MarkupParser:

Janne Jalkanen wrote:
> Murray Altheim wrote:
>> I've been looking around but can't find out how to turn off this
>> behaviour. Isn't there a setting somewhere to automatically remove
>> whitespace from links?
>
> You need to modify MarkupParser.ALLOWED_CHARS.

The actual variable is MarkupParser.PUNCTUATION_CHARS_ALLOWED, but I
got the point. The only problem is that it's currently unmodifiable,
as the variable is tagged as final. Would there be any problem in
removing that final keyword?

And while this alters the permitted characters for the parser, I don't
see that this keeps the PageManager/WikiPageProvider from creating pages
with other characters in them, nor can I find any enforcement of a set
of characters for WikiNames. If there's not meant to be any checks, is
there a chance we can add a stub filter method to the API to at least
permit subclasses from doing filters on incoming names? Not quite sure
how best to handle this...

Thanks,

Murray

[1] http://www.w3.org/TR/REC-xml/#NT-Name
...........................................................................
Murray Altheim <murray07 at altheim.com>                           ===  = =
http://www.altheim.com/murray/                                     = =  ===
SGML Grease Monkey, Banjo Player, Wantanabe Zen Monk               = =  = =

      Boundless wind and moon - the eye within eyes,
      Inexhaustible heaven and earth - the light beyond light,
      The willow dark, the flower bright - ten thousand houses,
      Knock at any door - there's one who will respond.
                                      -- The Blue Cliff Record

Reply via email to