root/galaxy-central/eggs/Cheetah-2.2.2-py2.6-macosx-10.6-universal-ucs2.egg/Cheetah/Utils/htmlDecode.py
@
3
リビジョン 3, 437 bytes (コミッタ: kohda, 14 年 前) |
---|
Rev | 行番号 | |
---|---|---|
[3] | 1 | """This is a copy of the htmlDecode function in Webware. |
2 | ||
3 | @@TR: It implemented more efficiently. | |
4 | ||
5 | """ | |
6 | ||
7 | from Cheetah.Utils.htmlEncode import htmlCodesReversed | |
8 | ||
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 |
Note: リポジトリブラウザについてのヘルプは TracBrowser
を参照してください。