Skip to content

Commit

Permalink
fix: unescape HTML entities in the returned text.
Browse files Browse the repository at this point in the history
  • Loading branch information
AlbertWeichselbraun committed Nov 15, 2018
1 parent 4a2fb5d commit 4cd3a87
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
setup(
# Metadata
name="inscriptis",
version="0.0.3.3",
version="0.0.3.4",
description='inscriptis - HTML to text converter.',
long_description=long_description,
long_description_content_type='text/markdown',
Expand Down
8 changes: 7 additions & 1 deletion src/inscriptis/html_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@
from inscriptis.html_properties import Display, WhiteSpace, Line
from inscriptis.table_engine import Table

try:
# python 2 compatibility
from HTMLParser import HTMLParser
except ImportError:
from html import unescape


class Inscriptis(object):

Expand Down Expand Up @@ -102,7 +108,7 @@ def get_text(self):
::returns:
a text representation of the parsed content
'''
return '\n'.join(chain(*self.clean_text_lines))
return unescape('\n'.join(chain(*self.clean_text_lines)))

def write_line(self, force=False):
'''
Expand Down

0 comments on commit 4cd3a87

Please sign in to comment.