strip spaces after removing tags
This commit is contained in:
parent
92b8009a62
commit
35e8958efd
2 changed files with 5 additions and 4 deletions
|
@ -278,7 +278,7 @@ class IMDb:
|
||||||
real_name = name[0]
|
real_name = name[0]
|
||||||
role_name = name[1]
|
role_name = name[1]
|
||||||
if role_name:
|
if role_name:
|
||||||
role_name = role_name.split('(')[0].replace('/ ...','').strip()
|
role_name = role_name.split('(')[0].replace('/ ...','')
|
||||||
credits['cast'].append((stripTags(real_name), stripTags(role_name)))
|
credits['cast'].append((stripTags(real_name), stripTags(role_name)))
|
||||||
self.credits = credits
|
self.credits = credits
|
||||||
return self.credits
|
return self.credits
|
||||||
|
|
|
@ -125,8 +125,9 @@ def html_entity_decode(s, encoding = 'utf-8'):
|
||||||
return u''.join(r)
|
return u''.join(r)
|
||||||
|
|
||||||
def stripTags(s):
|
def stripTags(s):
|
||||||
return djangohtml.strip_tags(htmldecode(s))
|
if s:
|
||||||
|
return djangohtml.strip_tags(htmldecode(s)).strip()
|
||||||
|
return u''
|
||||||
|
|
||||||
from htmlentitydefs import name2codepoint
|
from htmlentitydefs import name2codepoint
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue