Merge branch 'master' into subfolders-8.3
[pyTivo.git] / Cheetah / Utils / htmlDecode.py
blob2832a745191c6ad59ea19cb9143934e004113fcc
1 """This is a copy of the htmlDecode function in Webware.
3 @@TR: It implemented more efficiently.
5 """
7 from Cheetah.Utils.htmlEncode import htmlCodesReversed
9 def htmlDecode(s, codes=htmlCodesReversed):
10 """ Returns the ASCII decoded version of the given HTML string. This does
11 NOT remove normal HTML tags like <p>. It is the inverse of htmlEncode()."""
12 for code in codes:
13 s = s.replace(code[1], code[0])
14 return s