equal
deleted
inserted
replaced
150 def findparas(): |
150 def findparas(): |
151 start = 0 |
151 start = 0 |
152 while True: |
152 while True: |
153 m = para_re.search(text, start) |
153 m = para_re.search(text, start) |
154 if not m: |
154 if not m: |
155 uctext = unicode(text[start:], encoding.encoding) |
155 uctext = encoding.unifromlocal(text[start:]) |
156 w = len(uctext) |
156 w = len(uctext) |
157 while 0 < w and uctext[w - 1].isspace(): |
157 while 0 < w and uctext[w - 1].isspace(): |
158 w -= 1 |
158 w -= 1 |
159 yield (uctext[:w].encode(encoding.encoding), |
159 yield (encoding.unitolocal(uctext[:w]), |
160 uctext[w:].encode(encoding.encoding)) |
160 encoding.unitolocal(uctext[w:])) |
161 break |
161 break |
162 yield text[start:m.start(0)], m.group(1) |
162 yield text[start:m.start(0)], m.group(1) |
163 start = m.end(1) |
163 start = m.end(1) |
164 |
164 |
165 return "".join([util.wrap(space_re.sub(' ', util.wrap(para, width)), |
165 return "".join([util.wrap(space_re.sub(' ', util.wrap(para, width)), |