X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=parse_html%2Fbkmk_ph_html5.py;h=a4906288af13fe5da0cf3f24f39e30a010f7cbe7;hb=305d7fdf73e7b3ce64bb4d931c9ab8dd7e7642ea;hp=d883bd7e5f4b98dd4307fc8c56390411ac347d3c;hpb=338c964afba3651bd8fe6318644c0fcabb66cc3b;p=bookmarks_db.git diff --git a/parse_html/bkmk_ph_html5.py b/parse_html/bkmk_ph_html5.py index d883bd7..a490628 100644 --- a/parse_html/bkmk_ph_html5.py +++ b/parse_html/bkmk_ph_html5.py @@ -3,11 +3,8 @@ This file is a part of Bookmarks database and Internet robot. """ -__version__ = "$Revision$"[11:-2] -__revision__ = "$Id$"[5:-2] -__date__ = "$Date$"[7:-2] __author__ = "Oleg Broytman " -__copyright__ = "Copyright (C) 2010, 2011 PhiloSoft Design" +__copyright__ = "Copyright (C) 2010-2012 PhiloSoft Design" __license__ = "GNU GPL" __all__ = ['parse_html'] @@ -55,9 +52,6 @@ def parse_html(filename, charset=None, log=None): else: title = '' - if title is None: - return None - for node in head.childNodes: if node.name == 'meta' and \ ('http-equiv' in node.attributes) and \ @@ -75,7 +69,7 @@ def parse_html(filename, charset=None, log=None): if not charset: charset = parser.tokenizer.stream.charEncoding[0] - if charset or meta_charset: + if title and (charset or meta_charset): title = title.encode(charset or meta_charset) for node in head.childNodes: @@ -101,7 +95,6 @@ def parse_html(filename, charset=None, log=None): else: title = '' - if title is None: - return None - + if (title is None) and (refresh is None) and (icon is None): + return None return HTMLParser(charset, meta_charset, title, refresh, icon)