def link(url, text='', classes=''):
if not text: text = url
if classes: classes = ' class="%s"' % classes
return """%s""" % (url, classes, text)
def img(url, alt='', classes=''):
if not url.startswith('http://') and not url[:1]=='/':
#add media_url for relative paths
import settings
url = settings.MEDIA_URL + url
if classes: classes = ' class="%s"' % classes
if alt: alt = ' alt="%s" title="%s"' % (alt, alt)
return """""" % (url, classes, alt)