changeset 3188:fd905ed64dff

Added support for linebreaks in paragraphs by exiting the current paragraph element and creating a new one.
author Mikko Virkkil? <mvirkkil@cc.hut.fi>
date Wed, 05 Mar 2008 01:00:28 +0100
parents 4232b56627c7
children c13eca15e247
files MoinMoin/formatter/text_docbook.py
diffstat 1 files changed, 9 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/formatter/text_docbook.py	Wed Mar 05 00:46:53 2008 +0100
+++ b/MoinMoin/formatter/text_docbook.py	Wed Mar 05 01:00:28 2008 +0100
@@ -166,12 +166,18 @@
         return self._handleNode("para", on)
 
     def linebreak(self, preformatted=1):
+        """
+        If preformatted, it will simply output a linebreak.
+        If we are in a paragraph, we will close it, and open another one.
+        """
         if preformatted:
             self.text('\\n')
+        elif self.cur.nodeName == "para":
+            self.paragraph(0)
+            self.paragraph(1)
         else:
-            #this should not happen
-            #self.text('CRAP')
-            pass
+            self._emitComment("Warning: Probably not emitting right sort of linebreak")
+            self.text('\n')
         return ""
 
     def _handleNode(self, name, on, attributes=()):