comparison markup/core.py @ 6:71e8e645fe81 trunk

Simplified implementation of `py:content` directive.
author cmlenz
date Sun, 04 Jun 2006 10:46:14 +0000
parents dbb08edbc615
children 3710e3d0d4a2
comparison
equal deleted inserted replaced
5:dbb08edbc615 6:71e8e645fe81
244 .replace('>', '>') \ 244 .replace('>', '>') \
245 .replace('&lt;', '<') \ 245 .replace('&lt;', '<') \
246 .replace('&amp;', '&') 246 .replace('&amp;', '&')
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
Copyright (C) 2012-2017 Edgewall Software