chiark / gitweb /
Only make lists if a space follows the # or * sign
authorDaniel Martí <mvdan@mvdan.cc>
Thu, 27 Mar 2014 16:51:34 +0000 (17:51 +0100)
committerDaniel Martí <mvdan@mvdan.cc>
Thu, 27 Mar 2014 16:51:34 +0000 (17:51 +0100)
This prevents making a list item out of lines such as:

*.rom images and allows using...

fdroidserver/lint.py
fdroidserver/metadata.py

index ab3265132f9d451c65971cd910e38627573757fb..550216c5dda8a704608da4220f4a107b2759546e 100644 (file)
@@ -173,7 +173,7 @@ def main():
         # Invalid lists
         desc_chars = 0
         for line in app['Description']:
-            if re.match(r'[ ]*\*[^ ]', line):
+            if re.match(r'[ ]*[*#][^ .]', line):
                 warn("Invalid bulleted list: '%s'" % line)
             desc_chars += len(line)
 
index 3da4b0c9d221978feede2f614fab553c231a6c49..6274210cce5d1f2d12f0b2a23ab9835d1da0d131 100644 (file)
@@ -311,22 +311,22 @@ class DescriptionFormatter:
         self.text_wiki += "%s\n" % line
         if not line:
             self.endcur()
-        elif line.startswith('*'):
+        elif line.startswith('* '):
             self.endcur([self.stUL])
             if self.state != self.stUL:
                 self.text_html += '<ul>'
                 self.state = self.stUL
             self.text_html += '<li>'
-            self.text_plain += '*'
+            self.text_plain += '* '
             self.addtext(line[1:])
             self.text_html += '</li>'
-        elif line.startswith('#'):
+        elif line.startswith('# '):
             self.endcur([self.stOL])
             if self.state != self.stOL:
                 self.text_html += '<ol>'
                 self.state = self.stOL
             self.text_html += '<li>'
-            self.text_plain += '*' #TODO: lazy - put the numbers in!
+            self.text_plain += '* ' #TODO: lazy - put the numbers in!
             self.addtext(line[1:])
             self.text_html += '</li>'
         else: