[svn r38140] Empty literal blocks are not allowed: removing them.

--HG--
branch : trunk
This commit is contained in:
guido
2007-02-08 13:26:02 +01:00
parent 938680d50f
commit fd0cbdb95a
2 changed files with 15 additions and 1 deletions
+4 -1
View File
@@ -133,7 +133,8 @@ class Rest(AbstractNode):
for child in self.children:
outcome.append(child.text())
text = self.sep.join(outcome) + "\n" # trailing newline
# always a trailing newline
text = self.sep.join([i for i in outcome if i]) + "\n"
return text + self.render_links()
class Transition(AbstractNode):
@@ -251,6 +252,8 @@ class LiteralBlock(AbstractText):
start = '::\n\n'
def text(self):
if not self._text.strip():
return ''
text = self.escape(self._text).split('\n')
for i, line in py.builtin.enumerate(text):
if line.strip():