![]() |
#1 |
US Navy, Retired
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,888
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Kindle PaperWhite SE 11th Gen
|
Lit conversion w/<pre> tags
When I go to convert a lit file to a epub that has the text in <pre> tags I end up with an extra space between the paragraphs.
My pertinent conversion settings under Look & Feel are: Remove spacing between paragraphs w/indent 1.1em and Insert blank lines Lit file code Code:
<body> <pre>This book is for my wife, Danielle, with all my love for ever It had never been exposed to the light of day, not once in the 200 million years since it assumed its present form, and yet it seemed in itself to be a distilled drop of dirtied sunlight. It had been conceived in heat as vast as that of the sun's surface, in those unholy depths below the earth's crust, in the molten magma that welled up from the earth's very core. </pre> </body> Code:
<body class="calibre"> <p class="calibre7">This book is for my wife, Danielle, with all my love for ever</p> <p class="calibre7"> </p> <p class="calibre7">It had never been exposed to the light of day, not once in the 200 million years since it assumed its present form, and yet it seemed in itself to be a distilled drop of dirtied sunlight.</p> <p class="calibre7"> </p> <p class="calibre7">it had been conceived in heat as vast as that of the sun’s surface, in those unholy depths below the earth’s crust, in the molten magma that welled up from the earth’s very core.</p> </body> .calibre7 { border-bottom: 0; border-top: 0; display: block; margin-bottom: 0.5em; margin-left: 0; margin-right: 0; margin-top: 0.5em; padding-bottom: 0; padding-top: 0; text-indent: 1.1em } Showing the indent and the added top and bottom margin for the insert blank line. At some point in the past I don't believe the NBSP paragraphs were inserted. Is there a way to prevent these from being inserted? I tried heuristics - Delete blank lines between paragraphs without success. I have no problem editing these blank paragraphs out using Sigil. I'm hoping a calibre solution can be implemented. Last edited by DoctorOhh; 02-10-2011 at 01:21 AM. |
![]() |
![]() |
![]() |
#2 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,149
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
This will likely be because of the ongoing changes to the text input plugin (lit with <pre> uses that). You should open a ticket and attach a lit sample.
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
US Navy, Retired
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,888
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Kindle PaperWhite SE 11th Gen
|
|
![]() |
![]() |
![]() |
#4 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
|
I'm not sure if it's a bug - Am I reading it correctly that you have 'remove spacing' AND 'Insert blank lines' enabled? Those sort of conflict with one another... I think blank lines get inserted after heuristics if you want them inserted, but I'm not sure why you would have it enabled.
Also heuristics only deletes blank lines when it detects that every single paragraph is separated by a blank line. What's the formatting you're trying to achieve? I usually avoid both the 'insert blank line' and 'remove paragraph spacing' in favor of using extra css: Code:
p {margin-top:0.3em; margin-bottom:0.3em; text-indent:3%; text-align:justify} h1+p, h2+p, h3+p, p.whitespace+p, p.softbreak+p {margin-top:0.1em; margin-bottom:0.3em; text-indent:0%; text-align:justify} |
![]() |
![]() |
![]() |
#5 | ||||
US Navy, Retired
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,888
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Kindle PaperWhite SE 11th Gen
|
Thanks for the response.
Quote:
Quote:
IIRC previously if the text in the <pre> tags in a lit file (or text in a txt file) had the paragraphs separated by a blank line those paragraphs would end up in <p> tags and no extra lines with non-breaking spaces were created between those paragraphs. At what point does the <p class="calibre7"> </p> get inserted? It isn't from the insert blank line under look & feel because that just changes the top and bottom margin on the main paragraphs. Quote:
Code:
p {margin-top:0.5em; margin-bottom:0.5em; text-indent:1.1em} Quote:
Bottom line: At what point does the <p class="calibre7"> </p> get inserted and why? |
||||
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
|
I'm pretty sure the <p class="calibre7"> </p> is coming from the insert blank line option being enabled. I never use that option, but a review of the code corroborates that.
There have been a lot of bug fixes/improvements lately - Lit input had a bug in it where it was treating all content in <pre> tags as 'block', and that didn't work for the majority of Lit files using <pre> tags. So if Lit input detects a <pre> tag it now does text processing using 'Single', and a user can enable heuristics if they need unwrapping. Text input also had improvements where it's preserving soft scene breaks - i.e. empty lines. It's possible that a document that is both 'single' and 'block' - i.e. single line paragraphs with a blank line in between each one - might cause text input to create a lot of blank paragraph markers. If so, the 'delete blank paragraphs' option in heuristics would detect and get rid of those. The insert blank line option happens much further down the pipeline, looks like after remove paragraph spacing but before css rationalization - though I always thought remove paragraph spacing was part of css rationalization, maybe that happens during rationalization but before the user defined css is applied. Anyway in my experience if you use user defined css it will basically do the same thing as the checkbox, which your css settings and result corroborate. It sounds to me like you found a workflow that was working around old bugs, and now that some of that has been fixed you're seeing your old workflow impacted. That's just a guess though - It would take a bit of investigation to confirm - old and new versions of Calibre, etc. I think disabling insert blank line and increasing the margins in your extra css would probably be the best option for you, unless there really is a bug to be fixed, but I'm not sure I see one. Last edited by ldolse; 02-10-2011 at 06:46 AM. |
![]() |
![]() |
![]() |
#7 | ||||||
US Navy, Retired
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,888
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Kindle PaperWhite SE 11th Gen
|
Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
Code:
<body class="calibre"> <div class="calibre5"> <p class="calibre7">This book is for my wife, Danielle, with all my love for ever</p> <p class="calibre7"> </p> <p class="calibre7">It had never been exposed to the light of day, not once in the 200 million years since it assumed its present form, and yet it seemed in itself to be a distilled drop of dirtied sunlight.</p> <p class="calibre7"> </p> <p class="calibre7">it had been conceived in heat as vast as that of the sun’s surface, in those unholy depths below the earth’s crust, in the molten magma that welled up from the earth’s very core.</p> </div> </body> |
||||||
![]() |
![]() |
![]() |
#8 |
US Navy, Retired
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,888
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Kindle PaperWhite SE 11th Gen
|
Created Ticket #8904 - this isn't critical to me it is just no matter what I do I get the non-breaking space paragraphs inserted between each normal paragraph.
<p class="calibre?"> </p> This only takes me a minute in Sigil to correct. |
![]() |
![]() |
![]() |
#9 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
|
Ok, it does turn out to be a regression - will post more details in the bug.
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
<pre> tags and no text reflow in EPUB | sergio blum | Calibre | 24 | 10-14-2010 08:07 PM |
.lit conversion | bubulac | Calibre | 0 | 01-07-2010 11:33 PM |
Remove pre-conversion file? | JDThird | Calibre | 4 | 07-25-2009 03:59 PM |
lit conversion with the Kindle. | keving1701 | Amazon Kindle | 5 | 02-17-2008 06:25 PM |
.lit conversion question | uvholic | Sony Reader | 7 | 02-04-2008 10:26 PM |