1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-09-17 10:40:12 +02:00

Only make lists if a space follows the # or * sign

This prevents making a list item out of lines such as:

*.rom images and allows using...
This commit is contained in:
Daniel Martí 2014-03-27 17:51:34 +01:00
parent 6c6a9c4bb2
commit 65d796c93a
2 changed files with 5 additions and 5 deletions

View 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)

View 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: