Web & utils.web: Force HTMLParser to process all buffered data.

Python issue 23144.
This commit is contained in:
Jussi Timperi 2015-10-22 16:56:53 +03:00
parent 526ffb0ccb
commit df7689cc2e
2 changed files with 2 additions and 0 deletions

View File

@ -155,6 +155,7 @@ class Web(callbacks.PluginRegexp):
else:
return None
parser.feed(text)
parser.close()
title = parser.title
if title:
title = utils.web.htmlToText(parser.title.strip())

View File

@ -254,6 +254,7 @@ def htmlToText(s, tagReplace=' '):
pass
x = HtmlToText(tagReplace)
x.feed(s)
x.close()
return x.getText()
def mungeEmail(s):