striphtml: also convert ´ and collapse multiple space, as HTML display do
This commit is contained in:
parent
9fa8902f1a
commit
8988dd0d41
1 changed files with 7 additions and 4 deletions
|
@ -199,7 +199,10 @@ def striphtml(data):
|
|||
|
||||
import re
|
||||
p = re.compile(r'<.*?>')
|
||||
return htmlentitydecode(p.sub('', data)
|
||||
.replace("(", "/(")
|
||||
.replace(")", ")/")
|
||||
.replace(""", "\""))
|
||||
r, _ = re.subn(r' +', ' ', htmlentitydecode(p.sub('', data)
|
||||
.replace("(", "/(")
|
||||
.replace(")", ")/")
|
||||
.replace("'", "´")
|
||||
.replace(""", "\""))
|
||||
.replace('\n', ' '))
|
||||
return r
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue