Mercurial > genshi > genshi-test
comparison markup/core.py @ 6:5da45906dda7
Simplified implementation of `py:content` directive.
author | cmlenz |
---|---|
date | Sun, 04 Jun 2006 10:46:14 +0000 |
parents | 1add946decb8 |
children | ea47069a901c |
comparison
equal
deleted
inserted
replaced
5:1add946decb8 | 6:5da45906dda7 |
---|---|
244 .replace('>', '>') \ | 244 .replace('>', '>') \ |
245 .replace('<', '<') \ | 245 .replace('<', '<') \ |
246 .replace('&', '&') | 246 .replace('&', '&') |
247 | 247 |
248 def plaintext(self, keeplinebreaks=True): | 248 def plaintext(self, keeplinebreaks=True): |
249 """Returns the text as a `unicode`with all entities and tags removed.""" | 249 """Returns the text as a `unicode` string with all entities and tags |
250 removed. | |
251 """ | |
250 text = unicode(self.striptags().stripentities()) | 252 text = unicode(self.striptags().stripentities()) |
251 if not keeplinebreaks: | 253 if not keeplinebreaks: |
252 text = text.replace('\n', ' ') | 254 text = text.replace('\n', ' ') |
253 return text | 255 return text |
254 | 256 |