Hide HTML entity if it doesn't exist
Signed-off-by: Ivan Boothe <ivan@rootwork.org>
This commit is contained in:
		
							parent
							
								
									2462364d46
								
							
						
					
					
						commit
						d225b02bc9
					
				
					 1 changed files with 4 additions and 2 deletions
				
			
		
							
								
								
									
										6
									
								
								main.py
									
										
									
									
									
								
							
							
						
						
									
										6
									
								
								main.py
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -86,15 +86,17 @@ class KeywordQueryEventListener(EventListener):
 | 
			
		|||
                encoded = htmlentities.encode(char.character)
 | 
			
		||||
                if "&" in encoded:
 | 
			
		||||
                    sep = " - "
 | 
			
		||||
                    html = encoded
 | 
			
		||||
                else:
 | 
			
		||||
                    sep = ""
 | 
			
		||||
                    html = ""
 | 
			
		||||
                items.append(
 | 
			
		||||
                    ExtensionResultItem(
 | 
			
		||||
                        icon=image_path,
 | 
			
		||||
                        name=char.name.capitalize() + " - " + char.character,
 | 
			
		||||
                        description=char.block + " - U+" + char.code + sep + encoded,
 | 
			
		||||
                        description=char.block + " - U+" + char.code + sep + html,
 | 
			
		||||
                        on_enter=CopyToClipboardAction(char.character),
 | 
			
		||||
                        on_alt_enter=CopyToClipboardAction(encoded),
 | 
			
		||||
                        on_alt_enter=CopyToClipboardAction(html),
 | 
			
		||||
                    )
 | 
			
		||||
                )
 | 
			
		||||
        return RenderResultListAction(items)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Reference in a new issue