striphtml: also convert ´ and collapse multiple space, as HTML display do
This commit is contained in:
parent
9fa8902f1a
commit
8988dd0d41
@ -199,7 +199,10 @@ def striphtml(data):
|
||||
|
||||
import re
|
||||
p = re.compile(r'<.*?>')
|
||||
return htmlentitydecode(p.sub('', data)
|
||||
r, _ = re.subn(r' +', ' ', htmlentitydecode(p.sub('', data)
|
||||
.replace("(", "/(")
|
||||
.replace(")", ")/")
|
||||
.replace("'", "´")
|
||||
.replace(""", "\""))
|
||||
.replace('\n', ' '))
|
||||
return r
|
||||
|
Loading…
Reference in New Issue
Block a user