Skip to content
This repository has been archived by the owner on Oct 5, 2021. It is now read-only.

Commit

Permalink
fixed issue #91 ValueError: invalid literal for int()
Browse files Browse the repository at this point in the history
  • Loading branch information
Olivier Demah committed Jun 15, 2015
1 parent 0e754dd commit f1aee14
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions django_th/html_entities.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ def html_entity_decode_char(self, m, defs=htmlentities.entitydefs):
try:
char = defs[m.group(1)]
return "&{char};".format(char=char)
except ValueError:
return m.group(0)
except KeyError:
return m.group(0)

Expand All @@ -31,6 +33,8 @@ def html_entity_decode_codepoint(self, m,
try:
char = defs[m.group(1)]
return "&{char};".format(char=char)
except ValueError:
return m.group(0)
except KeyError:
return m.group(0)

Expand Down

0 comments on commit f1aee14

Please sign in to comment.