]> git.phdru.name Git - bookmarks_db.git/blobdiff - Robots/parse_html.py
Combined two "if"s.
[bookmarks_db.git] / Robots / parse_html.py
index 137ebfad9809d369712483bfa63b97744f7c6f1a..57f64985a58d5a096bc604acc37f2dbb9975a70b 100755 (executable)
@@ -32,9 +32,9 @@ num_entity_re = re.compile("(&#[0-9]+;)")
 def recode_entities(title, charset):
    output = []
    for part in entity_re.split(title):
-      if entity_re.match(part):
-         if part not in ("&", "<", ">", "&quote;", " "):
-            part = entitydefs.get(part[1:-1], part)
+      if part not in ("&", "<", ">", "&quote;", " ") and \
+            entity_re.match(part):
+         part = entitydefs.get(part[1:-1], part)
       output.append(part)
 
    output2 = []