Show More
@@ -38,9 +38,10 b' def findblocks(text):' | |||||
38 | blocks = [] |
|
38 | blocks = [] | |
39 | for b in _blockre.split(text.lstrip('\n').rstrip()): |
|
39 | for b in _blockre.split(text.lstrip('\n').rstrip()): | |
40 | lines = b.splitlines() |
|
40 | lines = b.splitlines() | |
41 | indent = min((len(l) - len(l.lstrip())) for l in lines) |
|
41 | if lines: | |
42 | lines = [l[indent:] for l in lines] |
|
42 | indent = min((len(l) - len(l.lstrip())) for l in lines) | |
43 | blocks.append(dict(indent=indent, lines=lines)) |
|
43 | lines = [l[indent:] for l in lines] | |
|
44 | blocks.append(dict(indent=indent, lines=lines)) | |||
44 | return blocks |
|
45 | return blocks | |
45 |
|
46 | |||
46 | def findliteralblocks(blocks): |
|
47 | def findliteralblocks(blocks): |
General Comments 0
You need to be logged in to leave comments.
Login now