]> git.phdru.name Git - bookmarks_db.git/blobdiff - Robots/parse_html.py
More logging.
[bookmarks_db.git] / Robots / parse_html.py
index fd8dc927c0d78d7adcd8394457774450ff9dd403..8ffca5c81bde3a095d57d697a0b8b234cd6f7fb7 100755 (executable)
@@ -2,7 +2,7 @@
 """
    HTML Parsers wrapper
 
-   Written by Broytman. Copyright (C) 1997-2008 PhiloSoft Design
+   Written by Broytman. Copyright (C) 1997-2010 PhiloSoft Design
 """
 
 import codecs
@@ -35,11 +35,9 @@ def recode_entities(title, charset):
       if part not in ("&", "<", ">", """) and \
             entity_re.match(part):
          _part = name2codepoint.get(part[1:-1], None)
-         if _part is None:
-             _part = part
-         else:
-             _part = unichr(_part).encode(charset)
-      output.append(_part)
+         if _part is not None:
+             part = unichr(_part).encode(charset)
+      output.append(part)
    title = ''.join(output)
 
    output = []