• Do not register here on develop.twiki.org, login with your twiki.org account.
• Use View topic Item7848 for generic doc work for TWiki-6.1.1. Use View topic Item7851 for doc work on extensions that are not part of a release. More... Close
• Anything you create or change in standard webs (Main, TWiki, Sandbox etc) will be automatically reverted on every SVN update.
Does this site look broken?. Use the LitterTray web for test cases.

WebTopicCreator is not stripping such characters as comma, exclamation points, periods, etc. If one enters "Last, First", it will change it to "Last,First".

Perhaps this is related to the change made in response to Item1595?

It looks like the isWikiWord check is not kicking in when the checkmark is not set.

When it kicks in it will need to be updated for I18N support - a version with better support for I18N topic names could look something like this:

function isWikiWord(inValue) {
   var upperAlphaRegex    = "[ܾǼA-Z]";
   var lowerAlphaRegex    = "[a-z]";
   var numericRegex      = "[\d]";
   var mixedAlphaRegex    = "[ܾǼ\w]";
   var mixedAlphaNumRegex = "[ܾǼ\w\d]";
   var wikiWordRegex = "\\b" + upperAlphaRegex + "+" + lowerAlphaRegex + "+" + upperAlphaRegex + "+" + mixedAlphaNumRegex + "*";
   var re = new RegExp(wikiWordRegex);
   return (inValue.match(re)) ? true : false;

\w seems to litterally mean a-zA-Z in javascript, so chars need to be mentioned explicitly (or?).

-- SP

  • Added above regexes
  • Added check for empty name
  • Strips illegal characters
  • Added feedback field
  • Refactored javascript


Very nice update Arthur! - Minor update: Removed a bit of UTF8 formatting from twiki.js and made it possible for first char of wikiword to be a i18n-char.

-- SP

I fixed a problem with illegal characters - instead it uses a list of allowed characters now. Don't know how this will hold with foreign languages though.

Steffen: I am having problems reading your commit: everything is garbled. Had to undo your last changes (partly), so please review/redo them.


Sorry for all of this charset conversion back and forth .. hope one day javascript will catch up with the wonders of UTF8 on mac smile

-- SP

Converted special chars to unicode escape sequence (\uXXXX).


Fixed a bug: boolean() to toBoolean().


I have found a few additions:

  • http://www.fileformat.info/info/unicode/category/index.htm lists unicode character categories, of which Uppercase and Lowercase are useful (except for mathematical characters and such).
    • I have added these characters to the regexes, but because twiki.js would get too big, I have removed them to a separate file: unicode_chars.js
  • Javascript has toLocaleUpperCase and toLocaleLowerCase to support international characters when doing case conversion.
  • The input form field should get focus at page load.

Commited these changes.


Excellent additions, thanks!

-- SP

Summary WebTopicCreator not stripping some disallowed characters
ReportedBy TWiki:Main.LynnwoodBrown
Codebase 4.0.0, 4.0.1, 4.0.2, ~twiki4
SVN Range Tue, 02 May 2006 build 10027
AppliesTo Engine

Priority Normal
CurrentState Closed

Checkins 10320 10321 10322 10323 10324 10328 10329 10331 10332 10334 10335 10336 10356 10357 10359 10360 10457 10458
TargetRelease patch
Edit | Attach | Watch | Print version | History: r46 < r45 < r44 < r43 < r42 | Backlinks | Raw View |  Raw edit | More topic actions
Topic revision: r46 - 2006-06-04 - SteffenPoulsen
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2023 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback