diff --git a/readability/readability.py b/readability/readability.py index 50b04f4..b0323b3 100755 --- a/readability/readability.py +++ b/readability/readability.py @@ -171,7 +171,7 @@ class Document: An internal method, which can be overridden in subclasses, for example, to disable or to improve DOM-to-text conversion in .summary() method """ - return clean_attributes(tounicode(self.html)) + return clean_attributes(tounicode(self.html, method='html')) def summary(self, html_partial=False): """ diff --git a/tests/test_article_only.py b/tests/test_article_only.py index f6595d9..120aee2 100644 --- a/tests/test_article_only.py +++ b/tests/test_article_only.py @@ -106,3 +106,8 @@ class TestArticleOnly(unittest.TestCase): s = doc.summary() assert 'foo' in s + + def test_not_self_closing(self): + sample = '

foobar

' + doc = Document(sample) + assert '

foobar

' == doc.summary()