Show More
@@ -73,7 +73,7 b' def findblocks(text):' | |||||
73 | if lines: |
|
73 | if lines: | |
74 | indent = min((len(l) - len(l.lstrip())) for l in lines) |
|
74 | indent = min((len(l) - len(l.lstrip())) for l in lines) | |
75 | lines = [l[indent:] for l in lines] |
|
75 | lines = [l[indent:] for l in lines] | |
76 |
blocks.append( |
|
76 | blocks.append({'indent': indent, 'lines': lines}) | |
77 | return blocks |
|
77 | return blocks | |
78 |
|
78 | |||
79 | def findliteralblocks(blocks): |
|
79 | def findliteralblocks(blocks): | |
@@ -174,8 +174,8 b' def splitparagraphs(blocks):' | |||||
174 | items = [] |
|
174 | items = [] | |
175 | for j, line in enumerate(lines): |
|
175 | for j, line in enumerate(lines): | |
176 | if match(lines, j, itemre, singleline): |
|
176 | if match(lines, j, itemre, singleline): | |
177 |
items.append( |
|
177 | items.append({'type': type, 'lines': [], | |
178 |
|
|
178 | 'indent': blocks[i]['indent']}) | |
179 | items[-1]['lines'].append(line) |
|
179 | items[-1]['lines'].append(line) | |
180 | blocks[i:i + 1] = items |
|
180 | blocks[i:i + 1] = items | |
181 | break |
|
181 | break | |
@@ -385,7 +385,7 b' def addmargins(blocks):' | |||||
385 | # no lines in previous block, do not separate |
|
385 | # no lines in previous block, do not separate | |
386 | i += 1 |
|
386 | i += 1 | |
387 | else: |
|
387 | else: | |
388 |
blocks.insert(i, |
|
388 | blocks.insert(i, {'lines': [''], 'indent': 0, 'type': 'margin'}) | |
389 | i += 2 |
|
389 | i += 2 | |
390 | return blocks |
|
390 | return blocks | |
391 |
|
391 |
General Comments 0
You need to be logged in to leave comments.
Login now