Merge pull request #420 from philipsd6/2.0-better_textwrap

Clean up text wrapping once and for all --- Please!
This commit is contained in:
Manuel Ebert 2016-04-07 13:13:54 -07:00
commit 4e153c6e09

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: