fix xhtml
This commit is contained in:
		
							parent
							
								
									4bf62193f3
								
							
						
					
					
						commit
						60aa7f073a
					
				
					 2 changed files with 3 additions and 2 deletions
				
			
		| 
						 | 
					@ -1363,7 +1363,7 @@ class ConversationTextview(GObject.GObject):
 | 
				
			||||||
            try:
 | 
					            try:
 | 
				
			||||||
                if name and (text.startswith('/me ') or text.startswith('/me\n')):
 | 
					                if name and (text.startswith('/me ') or text.startswith('/me\n')):
 | 
				
			||||||
                    xhtml = xhtml.replace('/me', '<i>* %s</i>' % (name,), 1)
 | 
					                    xhtml = xhtml.replace('/me', '<i>* %s</i>' % (name,), 1)
 | 
				
			||||||
                self.tv.display_html(xhtml.encode('utf-8'), self)
 | 
					                self.tv.display_html(xhtml, self)
 | 
				
			||||||
                return
 | 
					                return
 | 
				
			||||||
            except Exception as e:
 | 
					            except Exception as e:
 | 
				
			||||||
                gajim.log.debug('Error processing xhtml' + str(e))
 | 
					                gajim.log.debug('Error processing xhtml' + str(e))
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -525,7 +525,8 @@ class HtmlHandler(xml.sax.handler.ContentHandler):
 | 
				
			||||||
                # The "data" URL scheme http://tools.ietf.org/html/rfc2397
 | 
					                # The "data" URL scheme http://tools.ietf.org/html/rfc2397
 | 
				
			||||||
                import base64
 | 
					                import base64
 | 
				
			||||||
                img = attrs['src'].split(',')[1]
 | 
					                img = attrs['src'].split(',')[1]
 | 
				
			||||||
                mem = base64.standard_b64decode(urllib.parse.unquote(img))
 | 
					                mem = base64.standard_b64decode(urllib.parse.unquote(
 | 
				
			||||||
 | 
					                    img).encode('utf-8'))
 | 
				
			||||||
            elif loaded is not None:
 | 
					            elif loaded is not None:
 | 
				
			||||||
                (mem, alt, replace_mark) = loaded
 | 
					                (mem, alt, replace_mark) = loaded
 | 
				
			||||||
                update = True
 | 
					                update = True
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue