From 075871137379903b24255e0c148fc121ac7f3ed5 Mon Sep 17 00:00:00 2001 From: Erki Suurjaak Date: Fri, 26 Jun 2015 16:38:29 +0300 Subject: [PATCH] Fixed urlifying shared photos with Unicode content. --- skyperious/skypedata.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/skyperious/skypedata.py b/skyperious/skypedata.py index a1fb71a..bb95cb0 100644 --- a/skyperious/skypedata.py +++ b/skyperious/skypedata.py @@ -8,7 +8,7 @@ @author Erki Suurjaak @created 26.11.2011 -@modified 15.06.2015 +@modified 26.06.2015 ------------------------------------------------------------------------------ """ import cgi @@ -1782,11 +1782,10 @@ def parse_message_dom(self, message, options): else: # Parse link from message contents text = ElementTree.tostring(dom, "utf-8", "text") match = re.search("(https?://[^\s<]+)", text) - if match: + if match: # Make link clickable url = match.group(0) - # Make link clickable - linktempl = step.Template('{{url}}') - text2 = text.replace(url, linktempl.expand(url=url)) + a = step.Template('{{u}}').expand(u=url) + text2 = text.replace(url, a.encode("utf-8")) dom = self.make_xml(text2, message) or dom else: url = dom.find("URIObject").get("uri")