|
|
#1 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,409
Karma: 4132096
Join Date: Sep 2008
Device: Kindle Paperwhite/iOS Kindle App
|
Need help formatting HTML for good conversion
I had some HTML that I thought was perfect (converted from eReader, gone through and stripped of all code, saved with text editor etc) and they display fine on all my devices except a Libre I am testing. There are no line breaks in the mobipocket files on the Libre where there were on the Kindle. Someone told me I might not have used the right code. I have been finding that epub and a few other supported formats are showing up fine on the Libre using the same batch of files as my base for conversion, so short-term, the problem is solved. But I really don't want to be dealing with further issues every time I use a new device, so I am interested in getting my source files as clean as possible.
Even in the files which are now displaying better as epub, there is a problem with double line breaks not showing up. So I am wondering if the problem is mobi, or Calibre, or whomever not recognizing double line breaks. My document is plain text and what I had been doing was using Text Wrangler to replace the extraneous line breaks with double line breaks <br><br> If I do a find and replace and replace every <br><br> with </p><p> (to end the current paragraph and then start a new one) will that solve all my problems? If I have plain text with only these formatting marks, will I at last have clean HTML that will convert to anything? |
|
|
|
|
|
#2 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,409
Karma: 4132096
Join Date: Sep 2008
Device: Kindle Paperwhite/iOS Kindle App
|
Anybody?
|
|
|
|
| Advert | |
|
|
|
|
#3 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,196
Karma: 1281258
Join Date: Sep 2009
Device: PRS-505
|
Well, the line-breaks should be terminated (<br/>) as epub files are xhtml. Maybe that's your issue - just replace them all with terminated tags, which should also be compatible with html. Also, if there's no text in a block after a <br/> then the break will be ignored, so if you want to insert an extra line after a paragraph you need to do something like
Code:
<p>text text text<br /> </p> Code:
css -
.normal_paragraph {
margin-top: 0;
margin-bottom: 0;
text-indent: 1em;
}
.space_above {
margin-top: 1.2em;
margin-bottom: 0;
text-indent: 0;
}
body -
<p class="normal_paragraph">preceding section text</p>
<p class="space_above">New paragraph with one blank line above</p>
|
|
|
|
![]() |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| HTML formatting | MarcusStringer | ePub | 17 | 04-06-2010 12:23 PM |
| html2mobi - html formatting | brunovg | Kindle Formats | 2 | 12-13-2009 06:56 AM |
| HTML formatting | john folkard | Calibre | 1 | 08-18-2009 11:15 AM |
| html formatting question | Nate the great | Workshop | 49 | 07-17-2009 11:33 AM |
| Formatting a pdf or html..... | tmastern | Sony Reader | 3 | 12-12-2006 04:41 PM |