]> git.phdru.name Git - bookmarks_db.git/commitdiff
Unquote title for comparison.
authorOleg Broytman <phd@phdru.name>
Sat, 29 Dec 2007 16:01:38 +0000 (16:01 +0000)
committerOleg Broytman <phd@phdru.name>
Sat, 29 Dec 2007 16:01:38 +0000 (16:01 +0000)
git-svn-id: file:///home/phd/archive/SVN/bookmarks_db/trunk@147 fdd5c36f-1aea-0310-aeeb-c58d7e2b6c23

bkmk_objects.py
check_title.py

index cb6530369fa8c20d03619875dc08162933825766..b6905fb24898919838258ca407ccd9576d25a766 100644 (file)
@@ -175,3 +175,9 @@ def quote_title(title):
       #title = cgi.escape(title, 1).replace("'", "&#39;")
       title = title.replace("'", "&#39;")
    return title
+
+def unquote_title(title):
+   if BKMK_FORMAT == "MOZILLA":
+      from HTMLParser import HTMLParser
+      title = HTMLParser().unescape(title.replace("&amp;", '&'))
+   return title
index fee4c310e298b02edcf7e8fa9f8eb7fb304a3bb1..5c23cf615a28d0bc5fb6fd6883a5fe25c728f0b1 100755 (executable)
@@ -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: