mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-25 04:02:46 +01:00
Web & utils.web: Force HTMLParser to process all buffered data.
Python issue 23144.
This commit is contained in:
parent
526ffb0ccb
commit
df7689cc2e
@ -155,6 +155,7 @@ class Web(callbacks.PluginRegexp):
|
|||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
parser.feed(text)
|
parser.feed(text)
|
||||||
|
parser.close()
|
||||||
title = parser.title
|
title = parser.title
|
||||||
if title:
|
if title:
|
||||||
title = utils.web.htmlToText(parser.title.strip())
|
title = utils.web.htmlToText(parser.title.strip())
|
||||||
|
@ -254,6 +254,7 @@ def htmlToText(s, tagReplace=' '):
|
|||||||
pass
|
pass
|
||||||
x = HtmlToText(tagReplace)
|
x = HtmlToText(tagReplace)
|
||||||
x.feed(s)
|
x.feed(s)
|
||||||
|
x.close()
|
||||||
return x.getText()
|
return x.getText()
|
||||||
|
|
||||||
def mungeEmail(s):
|
def mungeEmail(s):
|
||||||
|
Loading…
Reference in New Issue
Block a user