Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #1383 (closed defect: fixed)

Opened 12 years ago

Last modified 12 years ago

[PATCH] toscawidgets/core.py -- valid_id should accept hypens, underscores, periods, colons

Reported by: ian Owned by: alberto
Priority: normal Milestone: 2.0
Component: ToscaWidgets Version: 1.0.2
Severity: normal Keywords:


As odd as it sounds, the w3c spec on 'id' attributes includes all sorts of things:

ID and NAME tokens must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens (”-”), underscores (”_”), colons (”:”), and periods (”.”).

so the valid_id regular expression on line 55 of toscawidgets/core.py should actually be: valid_id = re.compile(r'^[a-zA-Z][\w\-\_\:\.]*$').match

attached is a patch of this. I looked through the code and it seems like the underscores might confuse compound widgets, so more code might be needed to truly support this. Maybe in the meantime we should just take out the underscore from the above regular-expression? We should at least support hypens, as they are very common.



fix_id_regex.diff Download (379 bytes) - added by ian 12 years ago.

Change History

Changed 12 years ago by ian

comment:1 Changed 12 years ago by alberto

  • Status changed from new to closed
  • Resolution set to fixed

Applied a modified version at [3018]. Thanks :)


Note: See TracTickets for help on using tickets.