rupa / epub

python/curses cli epub reader
380 stars 63 forks source link

Leading newline in titles #20

Open Boruch-Baum opened 7 years ago

Boruch-Baum commented 7 years ago

I don't know whether this will prove to be a common issue, but the first (and so far only) epub book I tried to open with this script displayed the table of contents all wrong and strangely truncated. It turned out to be that somehow there were leading newline characters in each "title" string.

The fix for me was to change current line #173 from: screen.addstr(i, 0, '{0:-5} {1}'.format(start, title)) To: screen.addstr(i, 0, '{0:-5} {1}'.format(start, title.strip()))