def titlefilter(text): if not text: return "" text = text.strip() if not text: return "" key = hashlib.md5(text.encode('utf8')).hexdigest() cached = cache.get(key) if cached: return mark_safe(cached) text = widont( smartypants( caps( amp( text ) ) ) ) cache.set( key, text ) return mark_safe(text)
def filter(content, block): return amp(content)