Clean up text wrapping once and for all

This commit is contained in:
Philip Douglass 2016-01-24 20:05:59 -05:00
parent 3b7508eac6
commit eec009fd18

View file

@ -78,11 +78,11 @@ class Entry:
title = textwrap.fill(date_str + " " + self.title, self.journal.config['linewrap']) title = textwrap.fill(date_str + " " + self.title, self.journal.config['linewrap'])
body = "\n".join([ body = "\n".join([
textwrap.fill( textwrap.fill(
(line + " ") if (len(line) == 0) else line, line,
self.journal.config['linewrap'], self.journal.config['linewrap'],
initial_indent="| ", initial_indent="| ",
subsequent_indent="| ", subsequent_indent="| ",
drop_whitespace=True) drop_whitespace=True) or "| "
for line in self.body.rstrip(" \n").splitlines() for line in self.body.rstrip(" \n").splitlines()
]) ])
else: else: