strip spaces after removing tags

This commit is contained in:
j 2007-07-30 11:53:55 +00:00
parent 92b8009a62
commit 35e8958efd
2 changed files with 5 additions and 4 deletions

View file

@ -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

View file

@ -125,9 +125,10 @@ 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
# This pattern matches a character entity reference (a decimal numeric # This pattern matches a character entity reference (a decimal numeric