equal
deleted
inserted
replaced
261 """Return the final formatted document as a string.""" |
261 """Return the final formatted document as a string.""" |
262 if not self.header_written: |
262 if not self.header_written: |
263 # ensure we get a ".TH" as viewers require it. |
263 # ensure we get a ".TH" as viewers require it. |
264 self.head.append(self.header()) |
264 self.head.append(self.header()) |
265 # filter body |
265 # filter body |
266 for i in xrange(len(self.body) - 1, 0, -1): |
266 for i in range(len(self.body) - 1, 0, -1): |
267 # remove superfluous vertical gaps. |
267 # remove superfluous vertical gaps. |
268 if self.body[i] == '.sp\n': |
268 if self.body[i] == '.sp\n': |
269 if self.body[i - 1][:4] in ('.BI ','.IP '): |
269 if self.body[i - 1][:4] in ('.BI ','.IP '): |
270 self.body[i] = '.\n' |
270 self.body[i] = '.\n' |
271 elif (self.body[i - 1][:3] == '.B ' and |
271 elif (self.body[i - 1][:3] == '.B ' and |