#5821: Adds decode_entities to utils.html
------------------------------------------------+---------------------------
Reporter: Samuel Adam <[EMAIL PROTECTED]> | Owner: nobody
Status: new | Component: Tools
Version: SVN | Keywords: html
Stage: Unreviewed | Has_patch: 1
------------------------------------------------+---------------------------
This patch adds html entities decoding function to utils.html
== Description ==
Replaces HTML entities (name, decimal and hexadecimal) with unicode
equivalents.[[BR]]
Ampersands, quotes and carets are not replaced by default.
== Usage ==
'''decode_entities''' can be used to normalize and store user input from a
js html editor for example.[[BR]]
If you need to cut a string that could contain HTML entities, you can
decode it before the cut without the fear of cutting through an entity.
== Examples ==
{{{
#!python
>>> from django.utils.html import decode_entities
>>> html = u'<Déjà 〈>'
>>> decode_entities(html)
u'<D\xe9j\xe0 \u2329>'
>>> decode_entities(html, decode_all=True)
u'<D\xe9j\xe0 \u2329>'
}}}
--
Ticket URL: <http://code.djangoproject.com/ticket/5821>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---