Comments
Patch
@@ -186,6 +186,43 @@
blocks = minirst.parse(text)[0]
+ def gatherbullets(offset):
+ bullet_points = []
+
+ for i in range(offset + 1, len(blocks)):
+ block = blocks[i]
+
+ if block['type'] == 'margin':
+ continue
+ elif block['type'] == 'section':
+ break
+ elif block['type'] == 'bullet':
+ if block['indent'] != 0:
+ raise error.Abort(_('indented bullet lists not supported'))
+
+ lines = [[l[1:].strip() for l in block['lines']]]
+
+ if i < len(blocks)-1:
+ i+=1
+ block = blocks[i]
+ if block['type']=='paragraph':
+ lines.append(block['lines'])
+
+ while block['type']!='bullet' and i < len(blocks)-1:
+ if block['type'] == 'section':
+ break
+ i+=1
+ block=blocks[i]
+ if block['type']=='paragraph':
+ lines.append(block['lines'])
+ bullet_points.append(lines)
+ continue
+ elif block['type'] != 'paragraph':
+ raise error.Abort(_('unexpected block type in release notes: '
+ '%s') % block['type'])
+
+ return bullet_points
+
def gatherparagraphs(offset):
paragraphs = []
@@ -229,17 +266,19 @@
title)
currentsection = name
- paragraphs = gatherparagraphs(i)
- if paragraphs:
- notes.addnontitleditem(currentsection, paragraphs)
+ bullet_points = gatherbullets(i)
+ if bullet_points:
+ for para in bullet_points:
+ notes.addnontitleditem(currentsection, para)
# Sub-section.
elif block['underline'] == '-':
- paragraphs = gatherparagraphs(i)
-
if title == BULLET_SECTION:
- notes.addnontitleditem(currentsection, paragraphs)
+ bullet_points = gatherbullets(i)
+ for para in bullet_points:
+ notes.addnontitleditem(currentsection, para)
else:
+ paragraphs = gatherparagraphs(i)
notes.addtitleditem(currentsection, title, paragraphs)
else:
raise error.Abort(_('unsupported section type for %s') % title)