]> git.phdru.name Git - bookmarks_db.git/blobdiff - Robots/parse_html.py
2010.
[bookmarks_db.git] / Robots / parse_html.py
index 80c7aa89d28efed06db8a598088303f44d2b338b..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
@@ -34,7 +34,9 @@ def recode_entities(title, charset):
    for part in entity_re.split(title):
       if part not in ("&", "<", ">", """) and \
             entity_re.match(part):
-         part = unichr(name2codepoint.get(part[1:-1], part)).encode(charset)
+         _part = name2codepoint.get(part[1:-1], None)
+         if _part is not None:
+             part = unichr(_part).encode(charset)
       output.append(part)
    title = ''.join(output)