diff MoinMoin/parser/wiki.py @ 553:42c37dcdc314

fixed: no p within lists imported from: moin--main--1.5--patch-557
author Thomas Waldmann <tw@waldmann-edv.de>
date Tue, 11 Apr 2006 14:50:04 +0000
parents 44fa9948b41a
children c95125eee0e1
line wrap: on
line diff
--- a/MoinMoin/parser/wiki.py	Tue Apr 11 14:16:13 2006 +0000
+++ b/MoinMoin/parser/wiki.py	Tue Apr 11 14:50:04 2006 +0000
@@ -120,8 +120,9 @@
         self.is_u = 0
         self.is_strike = 0
         self.lineno = 0
-        self.in_li = 0
-        self.in_dd = 0
+        self.in_list = 0 # between <ul/ol/dl> and </ul/ol/dl>
+        self.in_li = 0 # between <li> and </li>
+        self.in_dd = 0 # between <dd> and </dd>
         self.in_pre = 0
         self.in_table = 0
         self.is_big = False
@@ -568,6 +569,7 @@
             close[0:0] = [self.formatter.table(0)]
             self.in_table = 0
         
+        self.in_list = self.list_types != []
         return ''.join(close) + ''.join(open)
 
 
@@ -863,7 +865,8 @@
                 result.append(self.formatter.text(line[lastpos:match.start()]))
             
             # Replace match with markup
-            if not (self.inhibit_p or self.in_pre or self.formatter.in_p or self.in_table):
+            if not (self.inhibit_p or self.in_pre or self.formatter.in_p or
+                    self.in_table or self.in_list):
                 result.append(self.formatter.paragraph(1, css_class="line867"))
             result.append(self.replace(match))
             lastpos = match.end()
@@ -871,7 +874,7 @@
         ###result.append('<span class="info">[no match, add rest: <tt>"%s"<tt>]</span>' % line[lastpos:])
         
         # Add paragraph with the remainder of the line
-        if not (self.in_pre or self.inhibit_p or
+        if not (self.in_pre or self.in_li or self.in_dd or self.inhibit_p or
                 self.formatter.in_p) and lastpos < len(line):
             result.append(self.formatter.paragraph(1, css_class="line874"))
         result.append(self.formatter.text(line[lastpos:]))