diff options
author | Tithen-Firion <tithen.firion.0@gmail.com> | 2017-04-28 17:34:27 +0200 |
---|---|---|
committer | Tithen-Firion <tithen.firion.0@gmail.com> | 2017-04-28 17:34:27 +0200 |
commit | edd9221cd22614b9d06f52b16bad278201fabd01 (patch) | |
tree | b11abb5899ae457bfc48fdf0e40e945f099147d5 | |
parent | bc8a2ea07107c65e3561826b066888d450b98391 (diff) |
[utils] Fix inconsistent output of clean_html
`\s` in Python 2.x doesn't match unicode whitespace characters by
default
-rw-r--r-- | youtube_dl/utils.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py index 91e235ff2..41bc20544 100644 --- a/youtube_dl/utils.py +++ b/youtube_dl/utils.py @@ -421,8 +421,8 @@ def clean_html(html): # Newline vs <br /> html = html.replace('\n', ' ') - 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) + html = re.sub(r'(?u)\s*<\s*br\s*/?\s*>\s*', '\n', html) + html = re.sub(r'(?u)<\s*/\s*p\s*>\s*<\s*p[^>]*>', '\n', html) # Strip html tags html = re.sub('<.*?>', '', html) # Replace html entities |