+
+def cleanup_urls(url):
+ return quote_plus(strip_tags(url))
+
+
+def html2text(s, ignore_tags=(), indent_width=4, page_width=80):
+ ignore_tags = [t.lower() for t in ignore_tags]
+ parser = HTML2Text(ignore_tags, indent_width, page_width)
+ parser.feed(s)
+ parser.close()
+ parser.generate()
+ return mark_safe(parser.result)
+
+def buildtag(name, content, **attrs):
+ return mark_safe('<%s %s>%s</%s>' % (name, " ".join('%s="%s"' % i for i in attrs.items()), unicode(content), name))
+
+def hyperlink(url, title, **attrs):
+ return mark_safe('<a href="%s" %s>%s</a>' % (url, " ".join('%s="%s"' % i for i in attrs.items()), title))
+
+def objlink(obj, **attrs):
+ return hyperlink(settings.APP_URL + obj.get_absolute_url(), unicode(obj), **attrs)
+
+
+
+