| 
			
			 | 
		#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: 45,609 
				Karma: 28549044 
				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: 13,698 
				Karma: 79983758 
				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?
		 
		
	
		
		
		
		
		
		
		
		
		
		
	
	 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#5 | |
| 
			
			
			
			 Well trained by Cats 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,267 
				Karma: 61916422 
				Join Date: Aug 2009 
				Location: The Central Coast of California 
				
				
				Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A 
				
				
				 | 
	
	
	
		
		
		
		
		 Quote: 
	
   when wrapping a Initial Letter or small cappin with a span.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 03: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 04:56 AM.  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#8 | 
| 
			
			
			
			 creator of calibre 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,609 
				Karma: 28549044 
				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: 45,609 
				Karma: 28549044 
				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 |