X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;ds=sidebyside;f=Robots%2Fparse_html.py;h=66400b5fd4b711106d9f44a866ecaceece972f8d;hb=5b927f4924fdb9fccb91e5b4477960e9c6dc0797;hp=fd901a8857883a7bc1c5e02d764f76be7f411406;hpb=8ae42a33f8948c056f5acff3f9748a28700c55f0;p=bookmarks_db.git diff --git a/Robots/parse_html.py b/Robots/parse_html.py index fd901a8..66400b5 100755 --- a/Robots/parse_html.py +++ b/Robots/parse_html.py @@ -2,7 +2,7 @@ """ HTML Parsers wrapper - Written by BroytMann. Copyright (C) 1997-2008 PhiloSoft Design + Written by Broytman. Copyright (C) 1997-2008 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)