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