From: Oleg Broytman Date: Tue, 18 Dec 2007 18:40:42 +0000 (+0000) Subject: Do all manipulations with title in one place. X-Git-Tag: v4.5.3~258 X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=6dedb3549bfb4accfd29f7ccc5533c1e3f5a7348;p=bookmarks_db.git Do all manipulations with title in one place. git-svn-id: file:///home/phd/archive/SVN/bookmarks_db/trunk@118 fdd5c36f-1aea-0310-aeeb-c58d7e2b6c23 --- diff --git a/Robots/bkmk_rsimple.py b/Robots/bkmk_rsimple.py index 27c7dc3..77c7a15 100644 --- a/Robots/bkmk_rsimple.py +++ b/Robots/bkmk_rsimple.py @@ -144,9 +144,7 @@ class robot_simple(Robot): if self.log: self.log(" no charset in Content-Type header") if content_type == "text/html": parser = parse_html(fname, charset, self.log) - title = parser.title.replace('\r', '').replace('\n', ' ').strip() - bookmark.real_title = parser.unescape(title) - if self.log: self.log(" final title : %s" % bookmark.real_title) + bookmark.real_title = parser.title if parser.refresh: refresh = parser.refresh try: diff --git a/Robots/parse_html.py b/Robots/parse_html.py index 96022b0..4117b5f 100755 --- a/Robots/parse_html.py +++ b/Robots/parse_html.py @@ -83,7 +83,10 @@ def parse_html(filename, charset=None, log=None): except LookupError: if log: log(" unknown charset: `%s' or `%s'" % (parser.charset, current_charset)) - parser.title = recode_entities(title, current_charset) + title = recode_entities(title, current_charset) + title = title.replace('\r', '').replace('\n', ' ').strip() + if self.log: self.log(" final title : %s" % title) + parser.title = title return parser