diff --git a/frontends/src/tools/strings.py b/frontends/src/tools/strings.py
index 6a1921a5..a244026a 100644
--- a/frontends/src/tools/strings.py
+++ b/frontends/src/tools/strings.py
@@ -54,3 +54,12 @@ def addURLToText(string):
return '%s' % (url, match.group(0))
pattern = r"""(?i)\b((?:[a-z]{3,}://|(www|ftp)\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}/|mailto:|xmpp:)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?]))"""
return re.sub(pattern, repl, string)
+
+
+def addURLToImage(string):
+ """Check a XHTML text for what looks like an imageURL and make it clickable"""
+ def repl(match):
+ url = match.group(1)
+ return '%s' % (url, match.group(0))
+ pattern = r"""
]* src="([^"]+)"[^>]*>"""
+ return re.sub(pattern, repl, string)