Mercurial > mez_xml
comparison tools.py @ 4:1727286834b5
Do not replace & with & for text to show &#xxxx;
author | Thinker K.F. Li <thinker@codemud.net> |
---|---|
date | Fri, 29 Oct 2010 17:49:10 +0800 |
parents | 3679d2d8443a |
children | d310e097c6de |
comparison
equal
deleted
inserted
replaced
3:f181a1ba4f9f | 4:1727286834b5 |
---|---|
125 | 125 |
126 def _esc_text(self, data): | 126 def _esc_text(self, data): |
127 import types | 127 import types |
128 if not (isinstance(data, types.StringTypes) and self.safe): | 128 if not (isinstance(data, types.StringTypes) and self.safe): |
129 return str(data) | 129 return str(data) |
130 return str(data.replace('&', '&').replace('<', '<').replace('>', '>')) | 130 return str(data.replace('<', '<').replace('>', '>')) |
131 | 131 |
132 def _esc_cdata(self, data): | 132 def _esc_cdata(self, data): |
133 import types | 133 import types |
134 if not (isinstance(data, types.StringTypes) and self.safe): | 134 if not (isinstance(data, types.StringTypes) and self.safe): |
135 return str(data) | 135 return str(data) |