# HG changeset patch # User cmlenz # Date 1149417974 0 # Node ID 71e8e645fe81d3f11712a5ce9cf1263b3916fd49 # Parent dbb08edbc61593e6b2a1c34adfd60bb0c853b159 Simplified implementation of `py:content` directive. diff --git a/examples/turbogears/markuptest/templates/master.html b/examples/turbogears/markuptest/templates/master.html --- a/examples/turbogears/markuptest/templates/master.html +++ b/examples/turbogears/markuptest/templates/master.html @@ -32,7 +32,7 @@
- ${select('*')} + ${select('*/*')}

TurboGears under the hood

diff --git a/markup/core.py b/markup/core.py --- a/markup/core.py +++ b/markup/core.py @@ -246,7 +246,9 @@ .replace('&', '&') def plaintext(self, keeplinebreaks=True): - """Returns the text as a `unicode`with all entities and tags removed.""" + """Returns the text as a `unicode` string with all entities and tags + removed. + """ text = unicode(self.striptags().stripentities()) if not keeplinebreaks: text = text.replace('\n', ' ') diff --git a/markup/template.py b/markup/template.py --- a/markup/template.py +++ b/markup/template.py @@ -242,11 +242,10 @@ if kind is Stream.START: yield kind, data, pos # emit start tag yield Stream.EXPR, self.expr, pos - previous = None - try: - while True: - previous = stream.next() - except StopIteration: + previous = stream.next() + for event in stream: + previous = event + else: if previous is not None: yield previous