# HG changeset patch # User Thierry Florac # Date 1497879939 -7200 # Node ID 483b701c99db5c3ce92cadbac4dfc95147d64982 # Parent 3eed5cd878f5db21cfe00154133c78e357091dbf Updated docstrings and doctests diff -r 3eed5cd878f5 -r 483b701c99db src/pyams_utils/html.py --- a/src/pyams_utils/html.py Mon Jun 19 15:43:27 2017 +0200 +++ b/src/pyams_utils/html.py Mon Jun 19 15:45:39 2017 +0200 @@ -110,11 +110,19 @@ >>> html_to_text(html) 'This is a HTML text part.\\n' + >>> html = '''

This is text with french accents: é à è ù

''' + >>> html_to_text(html) + 'This is text with french accents: é à è ù\\n' + HTML parser should handle entities correctly: + >>> html = '''

Header

This is an < ò > entity.

''' + >>> html_to_text(html) + 'Header\\nThis is an < ò > entity.\\n\\n' + >>> html = '''

Header

This is an < ò > entity.

''' >>> html_to_text(html) - 'Header\\nThis is an < o > entity.\\n\\n' + 'Header\\nThis is an <\xa0ò\xa0> entity.\\n\\n' """ if value is None: return ''