mirror of
				https://github.com/kovidgoyal/calibre.git
				synced 2025-11-03 19:17:02 -05:00 
			
		
		
		
	ToC editor: Fix generating toc entries from links not working for links that start with #
This commit is contained in:
		
							parent
							
								
									b20be85375
								
							
						
					
					
						commit
						a6ef8f7efd
					
				@ -468,7 +468,10 @@ def from_links(container):
 | 
				
			|||||||
            href = a.get('href')
 | 
					            href = a.get('href')
 | 
				
			||||||
            if not href or not href.strip():
 | 
					            if not href or not href.strip():
 | 
				
			||||||
                continue
 | 
					                continue
 | 
				
			||||||
            dest = container.href_to_name(href, base=name)
 | 
					            if href.startswith('#'):
 | 
				
			||||||
 | 
					                dest = name
 | 
				
			||||||
 | 
					            else:
 | 
				
			||||||
 | 
					                dest = container.href_to_name(href, base=name)
 | 
				
			||||||
            frag = href.rpartition('#')[-1] or None
 | 
					            frag = href.rpartition('#')[-1] or None
 | 
				
			||||||
            if (dest, frag) in seen_dests:
 | 
					            if (dest, frag) in seen_dests:
 | 
				
			||||||
                continue
 | 
					                continue
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user