02-08-2016, 09:57 AM | #1 |
Connoisseur
Posts: 82
Karma: 25684
Join Date: Sep 2014
Device: Kindle NT
|
Possibile bug in Beautifier
When I apply Beautify, a code like this:
Code:
<h1>C<span class="smallcaps">HAPTER</span> O<span class="smallcaps">NE</span></h1> Code:
<h1>C <span class="smallcaps">HAPTER</span> O <span class="smallcaps">NE</span> </h1> After: Wrong spaces have been added Am i doing something wrong? |
02-08-2016, 11:24 AM | #2 |
creator of calibre
Posts: 44,530
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
I cannot reproduce this, copy pasting your example and running beautify, results in
Code:
<h1>C<span class="smallcaps">HAPTER</span> O<span class="smallcaps">NE</span></h1> |
Advert | |
|
02-08-2016, 02:55 PM | #3 |
Connoisseur
Posts: 82
Karma: 25684
Join Date: Sep 2014
Device: Kindle NT
|
I'm Using Calibre 64bit 2.50.1 and Calibre 32bit (same version) on Windows 7.
They both give the same result. |
02-08-2016, 06:56 PM | #4 |
Grand Sorcerer
Posts: 12,746
Karma: 75000002
Join Date: Nov 2007
Location: Toronto
Device: Libra H2O, Libra Colour
|
Why not attach a complete epub showing the issue? Maybe 2 chapters; one pre beautify; one post beautify?
|
02-09-2016, 12:15 AM | #5 | |
Well trained by Cats
Posts: 30,442
Karma: 58055868
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
It does not happen that often, so maybe the coder is using a non-breaking character at the Span to keep it from splitting the C from hapter |
|
Advert | |
|
02-09-2016, 03:36 AM | #6 | |
Connoisseur
Posts: 82
Karma: 25684
Join Date: Sep 2014
Device: Kindle NT
|
Quote:
Note that applying beautifier again and again, the space between lines increases. Last edited by senhal; 02-09-2016 at 03:39 AM. |
|
02-09-2016, 04:54 AM | #7 |
Interested in the matter
Posts: 421
Karma: 426094
Join Date: Dec 2011
Location: Spain, south coast
Device: Pocketbook InkPad 3
|
Curious...
Only it happens when there is only one line of code inside <body>. With two lines working properly. Code:
<h1>C<span class="smallcaps">HAPTER</span> O<span class="smallcaps">NE</span></h1> <h1>C<span class="smallcaps">HAPTER</span> O<span class="smallcaps">NE</span></h1> Last edited by jbacelar; 02-09-2016 at 04:56 AM. |
02-09-2016, 07:28 AM | #8 |
creator of calibre
Posts: 44,530
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Ah yes that will be because of a heuristic in the beautifier. Normally, the beautifier does not adjust code inside a block level tag, precisely because of the problem described here, except in the case of the block level tag being the only child of body, in which case it is assumed to be a wrapper tag. I suppose I can adjust the heuristic to also check the tag name and reject heading tags, since they are unlikely to be wrapper tags.
|
02-09-2016, 08:15 AM | #9 | |
Connoisseur
Posts: 82
Karma: 25684
Join Date: Sep 2014
Device: Kindle NT
|
Quote:
However, the same happens with: Code:
<p>C<span class="smallcaps">HAPTER</span> O<span class="smallcaps">NE</span></p> |
|
02-09-2016, 11:46 PM | #10 |
creator of calibre
Posts: 44,530
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Yes, it will happen with any block level tag, as I explained before. It is a tradeoff, either one disables this functionality in which the common pattern of having all content in a top level wrapper tag will not be beautified or one accepts that int he rare case of html files having a single block level tag, the beautifier will insert extra spaces.
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[BUG] - M96 out of memory - [BUG] | Alf77 | Onyx Boox | 5 | 02-05-2015 12:47 PM |
DR800 Help, I've got a bug!! A bug on my screen!! | Franky | iRex | 4 | 06-21-2011 12:45 PM |
Embedded font bug or CSS bug in ADE | JSWolf | ePub | 10 | 06-11-2011 03:34 PM |
Is it a bug or is it me? | jekoby | Calibre | 13 | 03-29-2011 04:23 PM |
PRS-505 bug or eBookLib bug? | porkupan | Sony Reader | 3 | 10-07-2007 11:44 PM |