|08-09-2009, 11:08 AM||#1|
Join Date: Apr 2009
Device: Sony Reader 505
Create proper paragraph breaks in ereader2html
When using ereader2html.py to read books on my Sony, I noticed that there are no spaces betwen paragraphs, nor are there any indentations. Looking closer at the output html, I noticed that the original paragraph indents are present (as spaces), and that paragraphs are separated by a line break only (<br>). This works for ereader files, but in html, the spaces at the beginning of the line get ignored. This generates a file that is much harder to read, as you have neither an indentation nor an extra space to separate paragraphs.
As a workaround, I replaced the line in the ereader2html source code
s = s.replace('\n', '<br>\n')
s = s.replace('\n', '<p>\n').
Now individual paragraphs are separated by spaces. Also, you can now use calibre's "Remove spacing between paragraphs." option if you want to remove spaces between paragraphs and use indents instead.
Depending on how the publisher uses the \n tag in the original ereader code, you might introduce other formatting quirks. But, in most cases, I think this change creates a more readable text.
|08-10-2009, 03:54 PM||#2|
Join Date: Jul 2008
Device: K4B, KK, iPad 3 (Purged: K1, Cybook Opus, NST)
ooh! thanks. I'll give this a try. I was converting some files yesterday with ereader2html and noticed paragraph issues. The only one I went in and corrected though was one that had right justification instead of full...everything was justified to the right which looked nuts!
|08-10-2009, 11:02 PM||#3|
You kids get off my lawn!
Join Date: Aug 2007
Location: Columbus, Ohio
Device: Dell Axim, PRS350/650, Nook Glow, PB Touch Lux 623
I only get the problem with no spacing or indents on certain ereader files. Do you happen to know if this work around will cause too much spacing if the files would have converted alright with the old script?
|Thread Tools||Search this Thread|
|Thread||Thread Starter||Forum||Replies||Last Post|
|PDF to EPUB - spurious paragraph breaks||RichieTheK||Calibre||2||09-08-2010 11:27 AM|
|Paragraph breaks||thedevilsjester||Calibre||2||09-07-2010 12:26 PM|
|scanned PDF has weird paragraph breaks. Possible to fix||lunixer||0||08-30-2010 10:47 PM|
|Converting from LRF: Paragraph & Line Breaks||wudaben||LRF||0||07-14-2010 11:32 PM|
|Odd line/paragraph breaks in epub and FB2?||PKFFW||Calibre||4||10-01-2009 07:49 AM|