projects
/
diaspy.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9e1301e
)
Small changes in regexp used for cleaning notifications HTML text,
author
Marek Marecki
<triviuss@gmail.com>
Tue, 18 Jun 2013 22:01:13 +0000
(
00:01
+0200)
committer
Marek Marecki
<triviuss@gmail.com>
Tue, 18 Jun 2013 22:01:13 +0000
(
00:01
+0200)
it now includes more characters.
diaspy/models.py
patch
|
blob
|
blame
|
history
diff --git
a/diaspy/models.py
b/diaspy/models.py
index ec798cc709e60fbae4fc566b4671283cdc4aecc0..e78e82e71525f8a09ea9953f023df1246795ff7e 100644
(file)
--- a/
diaspy/models.py
+++ b/
diaspy/models.py
@@
-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):