better Vimeo tests; fixed a couple of VimeoIE fields

This commit is contained in:
Filippo Valsorda 2012-12-20 16:30:55 +01:00
parent 77c4beab8a
commit 6b3aef80ce
7 changed files with 18 additions and 17 deletions

View file

@ -298,7 +298,8 @@ def clean_html(html):
"""Clean an HTML snippet into a readable string"""
# Newline vs <br />
html = html.replace('\n', ' ')
html = re.sub('\s*<\s*br\s*/?\s*>\s*', '\n', html)
html = re.sub(r'\s*<\s*br\s*/?\s*>\s*', '\n', html)
html = re.sub(r'<\s*/\s*p\s*>\s*<\s*p[^>]*>', '\n', html)
# Strip html tags
html = re.sub('<.*?>', '', html)
# Replace html entities