diff --git a/boltons/strutils.py b/boltons/strutils.py index 02240c4..b8c25fb 100644 --- a/boltons/strutils.py +++ b/boltons/strutils.py @@ -544,8 +544,7 @@ class HTMLTextExtractor(HTMLParser): try: codepoint = htmlentitydefs.name2codepoint[name] except KeyError: - # likely not a real entity (possibly an unescaped part of a URL) - self.result.append(u'&' + name) + self.result.append(u'&' + name + u';') else: self.result.append(unichr(codepoint))