##// END OF EJS Templates
minirst: support all recommended title adornments
Martin Geisler -
r10984:68b7d2d6 default
parent child Browse files
Show More
@@ -225,6 +225,8 b' def prunecontainers(blocks, keep):'
225 return blocks, pruned
225 return blocks, pruned
226
226
227
227
228 _sectionre = re.compile(r"""^([-=`:.'"~^_*+#])\1+$""")
229
228 def findsections(blocks):
230 def findsections(blocks):
229 """Finds sections.
231 """Finds sections.
230
232
@@ -240,7 +242,8 b' def findsections(blocks):'
240 # +------------------------------+
242 # +------------------------------+
241 if (block['type'] == 'paragraph' and
243 if (block['type'] == 'paragraph' and
242 len(block['lines']) == 2 and
244 len(block['lines']) == 2 and
243 block['lines'][1] == '-' * len(block['lines'][0])):
245 len(block['lines'][0]) == len(block['lines'][1]) and
246 _sectionre.match(block['lines'][1])):
244 block['underline'] = block['lines'][1][0]
247 block['underline'] = block['lines'][1][0]
245 block['type'] = 'section'
248 block['type'] = 'section'
246 del block['lines'][1]
249 del block['lines'][1]
@@ -184,8 +184,14 b" debugformat('roles', roles, 60)"
184
184
185
185
186 sections = """
186 sections = """
187 A Somewhat Wide Section Header
187 Title
188 ------------------------------
188 =====
189
190 Section
191 -------
192
193 Subsection
194 ''''''''''
189
195
190 Markup: ``foo`` and :hg:`help`
196 Markup: ``foo`` and :hg:`help`
191 ------------------------------
197 ------------------------------
@@ -305,8 +305,14 b' Please see "hg add".'
305
305
306 sections formatted to fit within 20 characters:
306 sections formatted to fit within 20 characters:
307 ----------------------------------------------------------------------
307 ----------------------------------------------------------------------
308 A Somewhat Wide Section Header
308 Title
309 ------------------------------
309 =====
310
311 Section
312 -------
313
314 Subsection
315 ''''''''''
310
316
311 Markup: "foo" and "hg help"
317 Markup: "foo" and "hg help"
312 ---------------------------
318 ---------------------------
General Comments 0
You need to be logged in to leave comments. Login now