![]() |
#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? ![]() |
![]() |
![]() |
![]() |
#2 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 44,034
Karma: 22669822
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 | |
|
![]() |
#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. |
![]() |
![]() |
![]() |
#4 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,283
Karma: 74007256
Join Date: Nov 2007
Location: Toronto
Device: Nexus 7, Clara, Touch, Tolino EPOS
|
Why not attach a complete epub showing the issue? Maybe 2 chapters; one pre beautify; one post beautify?
|
![]() |
![]() |
![]() |
#5 | |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,002
Karma: 57259778
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 | |
|
![]() |
#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 02:39 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 03:56 AM. |
![]() |
![]() |
![]() |
#8 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 44,034
Karma: 22669822
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.
|
![]() |
![]() |
![]() |
#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> |
|
![]() |
![]() |
![]() |
#10 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 44,034
Karma: 22669822
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.
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
[BUG] - M96 out of memory - [BUG] | Alf77 | Onyx Boox | 5 | 02-05-2015 11:47 AM |
DR800 Help, I've got a bug!! A bug on my screen!! | Franky | iRex | 4 | 06-21-2011 11:45 AM |
Embedded font bug or CSS bug in ADE | JSWolf | ePub | 10 | 06-11-2011 02:34 PM |
Is it a bug or is it me? | jekoby | Calibre | 13 | 03-29-2011 03:23 PM |
PRS-505 bug or eBookLib bug? | porkupan | Sony Reader | 3 | 10-07-2007 10:44 PM |