From: Oleg Broytman Date: Sat, 29 Dec 2007 16:01:38 +0000 (+0000) Subject: Unquote title for comparison. X-Git-Tag: v4.5.3~229 X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=a8cce72842351341232a75a9e65f8e3890a0315f;p=bookmarks_db.git Unquote title for comparison. git-svn-id: file:///home/phd/archive/SVN/bookmarks_db/trunk@147 fdd5c36f-1aea-0310-aeeb-c58d7e2b6c23 --- diff --git a/bkmk_objects.py b/bkmk_objects.py index cb65303..b6905fb 100644 --- a/bkmk_objects.py +++ b/bkmk_objects.py @@ -175,3 +175,9 @@ def quote_title(title): #title = cgi.escape(title, 1).replace("'", "'") title = title.replace("'", "'") return title + +def unquote_title(title): + if BKMK_FORMAT == "MOZILLA": + from HTMLParser import HTMLParser + title = HTMLParser().unescape(title.replace("&", '&')) + return title diff --git a/check_title.py b/check_title.py index fee4c31..5c23cf6 100755 --- a/check_title.py +++ b/check_title.py @@ -6,7 +6,7 @@ """ import sys -from bkmk_objects import make_linear, quote_title +from bkmk_objects import make_linear, quote_title, unquote_title def run(): @@ -54,10 +54,11 @@ def run(): continue if hasattr(object, "real_title"): - quoted_title = quote_title(object.real_title) - if object.name <> quoted_title: + quoted_title = unquote_title(quote_title(object.real_title)) + unquoted_name = unquote_title(object.name) + if unquote_title(object.name) <> quoted_title: print object.href - print object.name + print unquoted_name print quoted_title print else: