##// END OF EJS Templates
minirst: detect bullet lists using asterisks...
Gregory Szorc -
r31130:6582b371 default
parent child Browse files
Show More
@@ -138,7 +138,7 def findliteralblocks(blocks):
138 i += 1
138 i += 1
139 return blocks
139 return blocks
140
140
141 _bulletre = re.compile(r'(-|[0-9A-Za-z]+\.|\(?[0-9A-Za-z]+\)|\|) ')
141 _bulletre = re.compile(r'(\*|-|[0-9A-Za-z]+\.|\(?[0-9A-Za-z]+\)|\|) ')
142 _optionre = re.compile(r'^(-([a-zA-Z0-9]), )?(--[a-z0-9-]+)'
142 _optionre = re.compile(r'^(-([a-zA-Z0-9]), )?(--[a-z0-9-]+)'
143 r'((.*) +)(.*)$')
143 r'((.*) +)(.*)$')
144 _fieldre = re.compile(r':(?![: ])([^:]*)(?<! ):[ ]+(.*)')
144 _fieldre = re.compile(r':(?![: ])([^:]*)(?<! ):[ ]+(.*)')
@@ -596,7 +596,7 def formathtml(blocks):
596 out.append(' <dt>%s\n <dd>%s\n' % (term, text))
596 out.append(' <dt>%s\n <dd>%s\n' % (term, text))
597 elif btype == 'bullet':
597 elif btype == 'bullet':
598 bullet, head = lines[0].split(' ', 1)
598 bullet, head = lines[0].split(' ', 1)
599 if bullet == '-':
599 if bullet in ('*', '-'):
600 openlist('ul', level)
600 openlist('ul', level)
601 else:
601 else:
602 openlist('ol', level)
602 openlist('ol', level)
@@ -118,6 +118,13 Line blocks are also a form of list:
118 | This is the first line.
118 | This is the first line.
119 The line continues here.
119 The line continues here.
120 | This is the second line.
120 | This is the second line.
121
122 Bullet lists are also detected:
123
124 * This is the first bullet
125 * This is the second bullet
126 It has 2 lines
127 * This is the third bullet
121 """
128 """
122
129
123 debugformats('lists', lists)
130 debugformats('lists', lists)
@@ -187,6 +187,12 Line blocks are also a form of list:
187
187
188 This is the first line. The line continues here.
188 This is the first line. The line continues here.
189 This is the second line.
189 This is the second line.
190
191 Bullet lists are also detected:
192
193 * This is the first bullet
194 * This is the second bullet It has 2 lines
195 * This is the third bullet
190 ----------------------------------------------------------------------
196 ----------------------------------------------------------------------
191
197
192 30 column format:
198 30 column format:
@@ -231,6 +237,14 list:
231 This is the first line. The
237 This is the first line. The
232 line continues here.
238 line continues here.
233 This is the second line.
239 This is the second line.
240
241 Bullet lists are also
242 detected:
243
244 * This is the first bullet
245 * This is the second bullet It
246 has 2 lines
247 * This is the third bullet
234 ----------------------------------------------------------------------
248 ----------------------------------------------------------------------
235
249
236 html format:
250 html format:
@@ -276,6 +290,14 Line blocks are also a form of list:
276 <li> This is the first line. The line continues here.
290 <li> This is the first line. The line continues here.
277 <li> This is the second line.
291 <li> This is the second line.
278 </ol>
292 </ol>
293 <p>
294 Bullet lists are also detected:
295 </p>
296 <ul>
297 <li> This is the first bullet
298 <li> This is the second bullet It has 2 lines
299 <li> This is the third bullet
300 </ul>
279 ----------------------------------------------------------------------
301 ----------------------------------------------------------------------
280
302
281 == options ==
303 == options ==
General Comments 0
You need to be logged in to leave comments. Login now