Small changes in regexp used for cleaning notifications HTML text,
authorMarek Marecki <triviuss@gmail.com>
Tue, 18 Jun 2013 22:01:13 +0000 (00:01 +0200)
committerMarek Marecki <triviuss@gmail.com>
Tue, 18 Jun 2013 22:01:13 +0000 (00:01 +0200)
it now includes more characters.

diaspy/models.py

index ec798cc709e60fbae4fc566b4671283cdc4aecc0..e78e82e71525f8a09ea9953f023df1246795ff7e 100644 (file)
@@ -72,8 +72,9 @@ class Notification():
     def __str__(self):
         """Returns notification note.
         """
-        string = re.sub('</?[a-z]+( *[a-z_-]+=["\'][a-zA-Z0-9/:_#.\- ]*["\'])* */?>', '', self.data['note_html'])
+        string = re.sub('</?[a-z]+( *[a-z_-]+=["\'][\w():.,!?#/\- ]*["\'])* */?>', '', self.data['note_html'])
         string = string.strip().split('\n')[0]
+        while '  ' in string: string = string.replace('  ', ' ')
         return string
 
     def __repr__(self):