Opened 15 years ago

Closed 15 years ago

#9891 closed (wontfix)

Add entity2unicode in `django.utils.html`

Reported by: rafael+django@… Owned by: nobody
Component: Uncategorized Version: 1.0
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

The html utils of Django could have this function:

import htmlentitydefs
entity_re = re.compile('&([a-z]+);', re.I)
def entity2unicode(text):
    for entity in entity_re.findall(text):
        print entity
        text = text.replace('&%s;'%entity, htmlentitydefs.entitydefs[entity].decode('iso-8859-1'))
    return text

Maybe it could be useful for someone else

Change History (1)

comment:1 by Jacob, 15 years ago

Resolution: wontfix
Status: newclosed

Things in django.utils are mostly support functions for Django itself, not functions designed for external use.

Note: See TracTickets for help on using tickets.
Back to Top