Show More
@@ -280,6 +280,8 b' def prunecomments(blocks):' | |||||
280 | b = blocks[i] |
|
280 | b = blocks[i] | |
281 | if b['type'] == 'paragraph' and b['lines'][0].startswith('.. '): |
|
281 | if b['type'] == 'paragraph' and b['lines'][0].startswith('.. '): | |
282 | del blocks[i] |
|
282 | del blocks[i] | |
|
283 | if i < len(blocks) and blocks[i]['type'] == 'margin': | |||
|
284 | del blocks[i] | |||
283 | else: |
|
285 | else: | |
284 | i += 1 |
|
286 | i += 1 | |
285 | return blocks |
|
287 | return blocks | |
@@ -397,8 +399,8 b' def format(text, width, indent=0, keep=N' | |||||
397 | blocks = hgrole(blocks) |
|
399 | blocks = hgrole(blocks) | |
398 | blocks = splitparagraphs(blocks) |
|
400 | blocks = splitparagraphs(blocks) | |
399 | blocks = updatefieldlists(blocks) |
|
401 | blocks = updatefieldlists(blocks) | |
|
402 | blocks = addmargins(blocks) | |||
400 | blocks = prunecomments(blocks) |
|
403 | blocks = prunecomments(blocks) | |
401 | blocks = addmargins(blocks) |
|
|||
402 | blocks = findadmonitions(blocks) |
|
404 | blocks = findadmonitions(blocks) | |
403 | text = '\n'.join(formatblock(b, width) for b in blocks) |
|
405 | text = '\n'.join(formatblock(b, width) for b in blocks) | |
404 | if keep is None: |
|
406 | if keep is None: | |
@@ -425,7 +427,7 b' if __name__ == "__main__":' | |||||
425 | blocks = debug(splitparagraphs, blocks) |
|
427 | blocks = debug(splitparagraphs, blocks) | |
426 | blocks = debug(updatefieldlists, blocks) |
|
428 | blocks = debug(updatefieldlists, blocks) | |
427 | blocks = debug(findsections, blocks) |
|
429 | blocks = debug(findsections, blocks) | |
|
430 | blocks = debug(addmargins, blocks) | |||
428 | blocks = debug(prunecomments, blocks) |
|
431 | blocks = debug(prunecomments, blocks) | |
429 | blocks = debug(addmargins, blocks) |
|
|||
430 | blocks = debug(findadmonitions, blocks) |
|
432 | blocks = debug(findadmonitions, blocks) | |
431 | print '\n'.join(formatblock(b, 30) for b in blocks) |
|
433 | print '\n'.join(formatblock(b, 30) for b in blocks) |
General Comments 0
You need to be logged in to leave comments.
Login now