|
|
#1 |
|
Enthusiast
![]() Posts: 39
Karma: 10
Join Date: Jun 2011
Location: Oamaru, New Zealand
Device: KT, Android Tablet and Phone
|
Bug converting html css text-indent and left-margin
Back in version 0.9.25 I converted by NIV Bible. It worked well.
Now I have revised the indentation of poetry and genealogical lists. But using calibre 1.21 the are removed and negative text-indent used with left-margin is incorrect. In the attached files (test.html, test.css) the indentation is correct in my browsers but not when I convert to azw3 for my kindle. Note: line 11: <p class="poet04"> <sup class="vn" id="v01010002">2</sup>The sons ... It converts to: <p class="poet"><sup class="vn" id="v01010002">2</sup>The sons ... The are removed which I am using for proper indentation. And the class="poet04" which has margin-left:4em; and text-indent:-4em; is changed to class="poet" with margin-left:4em; but text-indent:3% WRONG!! Note: line 9: <p> <sup class="vn" id="v01010001">1</sup>This is ... It converts to: <p class="calibre1"><sup class="vn" id="v01010001">1</sup>This is ... Again the are removed and the <p> tag is replaced by <p class="calibre1"> with a text-indent:3% which is close to correct. OK. Can the be left and the margin and text-indent settings be left so that my indentations will work correctly? If not what kind of fix should I use? Thanks, Kovid. Your program is great!! Thanks muchly for all the work you have put into it. |
|
|
|
|
|
#2 |
|
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,609
Karma: 28549044
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
The nbsp are not removed they are converted to the unicode nbsp character, which renders exactly the same.
|
|
|
|
| Advert | |
|
|
|
|
#3 |
|
Enthusiast
![]() Posts: 39
Karma: 10
Join Date: Jun 2011
Location: Oamaru, New Zealand
Device: KT, Android Tablet and Phone
|
Thanks, Kovid. But I gather that the unicode nbsp characters are then replaced by a text-indent which in the test.zip I have attached is wrong since it is not negative. See line 11 that I mentioned above for this.
I presume this is a bug. Last edited by bhoyt; 01-24-2014 at 04:45 PM. |
|
|
|
|
|
#4 |
|
ɴₐɴ
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 421
Karma: 2507940
Join Date: Jun 2011
Location: 37.2N 93.3W
Device: KV PW4 PW3 PW2
|
When I convert your test.zip to azw3, this is what I end up with:
Code:
<p class="poet">**<sup class="vn" id="v01010002">2</sup>The sons<sup class="fnr"><a class="calibre3" href="part0000.html#fn01010002a">1</a></sup> of Japheth:</p>
CSS:
.poet {
display: block;
text-align: left;
text-indent: -4em;
margin: 0 0 0 4em
}
I'm not sure why you would end up with a text-indent of 3%. |
|
|
|
|
|
#5 |
|
Enthusiast
![]() Posts: 39
Karma: 10
Join Date: Jun 2011
Location: Oamaru, New Zealand
Device: KT, Android Tablet and Phone
|
That's very strange! I just re-added the test.zip to make sure and then converted to azw3 and I get this (note there are no nbsp characters):
<p class="poet"><sup class="vn" id="v01010002">2</sup>The sons<sup class="fnr"><a href="part0000.html#fn01010002a">1</a></sup> of Japheth:</p> CSS: .poet { display: block; text-align: left; text-indent: 3%; margin: 0 0 0 4em } Why the difference? I am running Win7 and using Calibre 1.21 64bit Bruce Last edited by bhoyt; 01-24-2014 at 05:36 PM. |
|
|
|
| Advert | |
|
|
|
|
#6 |
|
ɴₐɴ
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 421
Karma: 2507940
Join Date: Jun 2011
Location: 37.2N 93.3W
Device: KV PW4 PW3 PW2
|
I'm running Win7 - Calibre 1.21 32bit. What input/output profiles are you using on Page Setup in the conversion dialogue? I don't think that would matter, however. I tried various combinations and ended up with the same results.
It is strange and I'm at a loss to explain it. You might try restoring defaults in the conversion options- though I don't see any settings that would cause your problem. Edit: I used the default input and Kindle Paperwhite for output. Last edited by JimmyR; 01-24-2014 at 05:41 PM. |
|
|
|
|
|
#7 |
|
Enthusiast
![]() Posts: 39
Karma: 10
Join Date: Jun 2011
Location: Oamaru, New Zealand
Device: KT, Android Tablet and Phone
|
Also strange is that a line down a bit with only one nbsp is rendered correctly:
<p class="poet3">*<sup class="vn" id="v01010013">13</sup>Mizraim was the father of</p> CSS: .poet3 { display: block; text-align: left; text-indent: -4em; margin: 0 0 0 4em } |
|
|
|
|
|
#8 |
|
ɴₐɴ
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 421
Karma: 2507940
Join Date: Jun 2011
Location: 37.2N 93.3W
Device: KV PW4 PW3 PW2
|
I got your results when I enabled "Smarten punctuation" in the Look & Feel options. Do you have that enabled? If so, disable it.
|
|
|
|
|
|
#9 |
|
Enthusiast
![]() Posts: 39
Karma: 10
Join Date: Jun 2011
Location: Oamaru, New Zealand
Device: KT, Android Tablet and Phone
|
Ah, yes!!! Thank you very much. That solved the problem.
But I wonder what smarten punctuation is doing with text-indent? |
|
|
|
|
|
#10 | |
|
ɴₐɴ
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 421
Karma: 2507940
Join Date: Jun 2011
Location: 37.2N 93.3W
Device: KV PW4 PW3 PW2
|
Great! Glad that sorted it.
Quote:
Again, glad it's working for you now. |
|
|
|
|
|
|
#11 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,251
Karma: 3720310
Join Date: Jan 2009
Location: USA
Device: Kindle, iPad (not used much for reading)
|
text-indent doesn't have anything to do with You shouldn't be using non-breaking spaces for indentation anyway, just the text-indent specification.
|
|
|
|
|
|
#12 |
|
Enthusiast
![]() Posts: 39
Karma: 10
Join Date: Jun 2011
Location: Oamaru, New Zealand
Device: KT, Android Tablet and Phone
|
Yes, I know that I should use text-indent for indent purposes but for this purpose it seems that nbsp is the better option. Why? because some verses have one digit numbers (1-9) and others have two digit numbers (10-99) and a few have three digit numbers (100+). That is a content matter not a CSS formatting matter.
I could do the indentation by requiring all numbers to be three digits (001-100+) but leading zeros doesn't look good. The text-indent option requires me to make a different class for three different sizes of verse numbers. That seems like forcing content into the CSS formatting. Any advice? |
|
|
|
|
|
#13 | |
|
ɴₐɴ
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 421
Karma: 2507940
Join Date: Jun 2011
Location: 37.2N 93.3W
Device: KV PW4 PW3 PW2
|
Apparently, multiple nbsps are removed and a 3% indent is added:
Quote:
|
|
|
|
|
|
|
#14 |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,269
Karma: 16544702
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
|
@bhoyt,
For this particular book, you should check the settings you had on the Convert - HeuristicProcessing page. If you have checked both of - the first box (Enable heuristics) and - the last box (Replace entity indents with CSS indents), you might find this is where the problem lies |
|
|
|
|
|
#15 |
|
Enthusiast
![]() Posts: 39
Karma: 10
Join Date: Jun 2011
Location: Oamaru, New Zealand
Device: KT, Android Tablet and Phone
|
jackie_w, I have heuristics disabled since I make format my own html files directly.
Jimmy-Jim, thanks for that link. It explains why 2 nbsp were converted to 3% indent, whereas 1 was not. |
|
|
|
![]() |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Margin/word flow issues when converting from RAR(CSS?) to epub... | camobmus | Conversion | 0 | 06-20-2013 05:20 PM |
| Reducing left-margin indent | Siavahda | ePub | 1 | 02-10-2013 01:40 PM |
| Calibre Indent Issue When Removing Blank Lines (Converting From HTML to MOBI or EPUB) | David Derrico | Calibre | 5 | 08-04-2010 01:13 AM |
| HTML to .MOBI: large l.h. margin; text cuts off on the rt. Ideas how to fix? | thorn | Calibre | 1 | 02-21-2010 02:47 AM |
| Small html/css bug | twaits | Calibre | 5 | 01-12-2010 11:26 AM |