| 
			
			 | 
		#616 | 
| 
			
			
			
			 Grand Sorcerer 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,698 
				Karma: 79983758 
				Join Date: Nov 2007 
				Location: Toronto 
				
				
				Device: Libra H2O, Libra Colour 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			Just tried the plugin on a genuine kEpub and then loaded it into Edit and did a check which reported several occurences opening and ending tag mismatches. 
		
	
		
		
		
		
		
		
		
		
		
		
	
	If you'd like to PM me an eMail address I'll supply a copy of the book I am testing with.  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#617 | 
| 
			
			
			
			 Wizard 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,760 
				Karma: 9918418 
				Join Date: Feb 2013 
				Location: Here on the perimeter, there are no stars 
				
				
				Device: Kobo H2O, iPad mini 3, Kindle Touch 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			PM sent, and I've updated the plugin code in my original message.
		 
		
	
		
		
		
		
		
		
		
		
		
		
	
	 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#618 | ||||
| 
			
			
			
			 Wizard 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,760 
				Karma: 9918418 
				Join Date: Feb 2013 
				Location: Here on the perimeter, there are no stars 
				
				
				Device: Kobo H2O, iPad mini 3, Kindle Touch 
				
				
				 | 
	
	
	
		
		
		
		
		 Quote: 
	
 Quote: 
	
 Quote: 
	
 Quote: 
	
  | 
||||
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#619 | 
| 
			
			
			
			 Guru 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 657 
				Karma: 64171 
				Join Date: Sep 2010 
				Location: Kent, England, Sol 3, ZZ9 plural Z Alpha 
				
				
				Device: Sony PRS-300, Kobo Aura HD, iPad (Marvin) 
				
				
				 | 
	
	
	
		
		
		
		
		  The self closing tags should have been caught in the elif clauseschange the -1 to a -2 in the line Code: 
	elif entity[-1:] == '/>': Last edited by Perkin; 04-06-2014 at 06:46 AM.  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#620 | 
| 
			
			
			
			 Grand Sorcerer 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,686 
				Karma: 12595249 
				Join Date: Jun 2009 
				Location: Madrid, Spain 
				
				
				Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			I'm testing this because the <span></span> are among the things I most dislike in a html file. Thank you very much.
		 
		
	
		
		
		
		
		
		
		
		
		
		
	
	 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#621 | |
| 
			
			
			
			 Grand Sorcerer 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,698 
				Karma: 79983758 
				Join Date: Nov 2007 
				Location: Toronto 
				
				
				Device: Libra H2O, Libra Colour 
				
				
				 | 
	
	
	
		
		
		
		
		 Quote: 
	
 I can't help but wonder if you might also want to remove the Code: 
	<a id="page_44"/> Last edited by PeterT; 04-07-2014 at 12:33 AM.  | 
|
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#622 | 
| 
			
			
			
			 Wizard 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,760 
				Karma: 9918418 
				Join Date: Feb 2013 
				Location: Here on the perimeter, there are no stars 
				
				
				Device: Kobo H2O, iPad mini 3, Kindle Touch 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			Those actually have a function; they correspond to the print book's pages. They don't do any harm, might do some good (depending on the NCX structure), and can't easily be restored if deleted, so I'm inclined to leave 'em alone.
		 
		
	
		
		
		
		
		
		
		
		
		
		
	
	 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#623 | 
| 
			
			
			
			 Guru 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 657 
				Karma: 64171 
				Join Date: Sep 2010 
				Location: Kent, England, Sol 3, ZZ9 plural Z Alpha 
				
				
				Device: Sony PRS-300, Kobo Aura HD, iPad (Marvin) 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			They could also be removed fairly simply with a s&r if they're not wanted, not as difficult as why these additions were being done. 
		
	
		
		
		
		
		
		
		
		
		
		
	
	Are they consistently declared across ebooks with their 'page_###'? Anyone who is offended by them would be editing a book, so would be able to do the simple s&r: Regex search Code: 
	<a id="page_\d+"/>  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#624 | |
| 
			
			
			
			 Wizard 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,760 
				Karma: 9918418 
				Join Date: Feb 2013 
				Location: Here on the perimeter, there are no stars 
				
				
				Device: Kobo H2O, iPad mini 3, Kindle Touch 
				
				
				 | 
	
	
	
		
		
		
		
		 Quote: 
	
 In other words, <hr></hr> is truncated to a bad <hr> instead of converted to a correct <hr/>. The culprit seems to be the logic in lines 590-591 of the attached version's modify.py, in which those elements are always assumed to be self-closing: Code: 
	elif entity[:3] == '<hr' or entity[:3] == '<br' or entity[:4] == '<img':
    this_entity.e_type = 3
Last edited by Rev. Bob; 04-07-2014 at 12:47 PM.  | 
|
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#625 | |
| 
			
			
			
			 Guru 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 657 
				Karma: 64171 
				Join Date: Sep 2010 
				Location: Kent, England, Sol 3, ZZ9 plural Z Alpha 
				
				
				Device: Sony PRS-300, Kobo Aura HD, iPad (Marvin) 
				
				
				 | 
	
	
	
		
		
		
		
		 Quote: 
	
 Code: 
	#!/usr/bin/env python import re result = re.sub(r'(<(.*)[^>]+)></\2>', r'\1/>', '<foo a="x" b="y"></foo>') print result  | 
|
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#626 | 
| 
			
			
			
			 Guru 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 657 
				Karma: 64171 
				Join Date: Sep 2010 
				Location: Kent, England, Sol 3, ZZ9 plural Z Alpha 
				
				
				Device: Sony PRS-300, Kobo Aura HD, iPad (Marvin) 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			I also meant to say regarding the non self-closing tags. 
		
	
		
		
		
		
		
		
		
		
		
		
		
			IIRC A lot of the elif's were to reduce length of processing time in pairing routine, be removing a lot of the elements needed to check, those (HR BR IMG) as you say should be self closing The previous elif would be catching the non-self-closing tags but not the end tag, thus causing the mismatch (which you probably realise) One way to change it to not catch them would be add a 1 and a space to each of the tests... Code: 
	elif entity[:4] == '<hr ' or entity[:4] == '<br ' or entity[:5] == '<img ':
    this_entity.e_type = 3
Last edited by Perkin; 04-07-2014 at 01:42 PM.  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#627 | |||
| 
			
			
			
			 Wizard 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,760 
				Karma: 9918418 
				Join Date: Feb 2013 
				Location: Here on the perimeter, there are no stars 
				
				
				Device: Kobo H2O, iPad mini 3, Kindle Touch 
				
				
				 | 
	
	
	
		
		
		
		
		 Quote: 
	
 Quote: 
	
 Quote: 
	
  | 
|||
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#628 | 
| 
			
			
			
			 Guru 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 657 
				Karma: 64171 
				Join Date: Sep 2010 
				Location: Kent, England, Sol 3, ZZ9 plural Z Alpha 
				
				
				Device: Sony PRS-300, Kobo Aura HD, iPad (Marvin) 
				
				
				 | 
	
	|
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#629 | 
| 
			
			
			
			 Wizard 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,760 
				Karma: 9918418 
				Join Date: Feb 2013 
				Location: Here on the perimeter, there are no stars 
				
				
				Device: Kobo H2O, iPad mini 3, Kindle Touch 
				
				
				 | 
	
	|
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#630 | |
| 
			
			
			
			 Guru 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 657 
				Karma: 64171 
				Join Date: Sep 2010 
				Location: Kent, England, Sol 3, ZZ9 plural Z Alpha 
				
				
				Device: Sony PRS-300, Kobo Aura HD, iPad (Marvin) 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			Just been re-reading the last few pages of the thread. 
		
	
		
		
		
		
		
		
		
		
		
		
	
	This was from post #574 made on 30-March Quote: 
	
 Say you had Code: 
	<i class="something">Here's</i><i> some text</i> Also thought about removing the empty tags i.e. '<i/>' or even '<i></i>' Could there be a reason not to remove them ~ maybe they could be changing the layout somehow, that if they're removed the layout may be different ~ Somewhere in my mind there's a niggle - something to do with seeing an empty tag that caused an alteration of linespacing or widths or ????. Anyway maybe it's more of a 'Do them by hand' rather than automated.  | 
|
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
![]()  | 
            
        
            
| Tags | 
| modify epub | 
            
  | 
    
			 
			Similar Threads
		 | 
	||||
| Thread | Thread Starter | Forum | Replies | Last Post | 
| [GUI Plugin] Quality Check | kiwidude | Plugins | 1277 | 10-21-2025 11:04 AM | 
| [GUI Plugin] Open With | kiwidude | Plugins | 404 | 02-21-2025 06:42 AM | 
| [GUI Plugin] Manage Series | kiwidude | Plugins | 167 | 07-28-2024 04:07 PM | 
| Modify ePub plugin dev thread | kiwidude | Development | 346 | 09-02-2013 06:14 PM | 
| [GUI Plugin] Plugin Updater **Deprecated** | kiwidude | Plugins | 159 | 06-19-2011 01:27 PM |