When a new issue is created or a message is added the title could be passed to
re.sub('[\t\n\r\f\v]+', '', title). This will remove all the whitespaces except
normal spaces (I don't see any valid reason to have tabs, newlines and similar
in the title anyway).
This regex will preserve the original normal spaces (so if the user put two or
more spaces they will be saved as they are).
A simpler approach is to use re.sub('\s+', ' ', title) (or '
'.join(title.split())) to replace all the whitespaces with a single space.
|