from StringIO import StringIO from trac.util import escape from trac.WikiFormatter import wiki_to_oneliner def unescape(text): """Un-escapes &, <, > and \"""" if not text: return '' return str(text).replace('&', '&') \ .replace('<', '<') \ .replace('>', '>') \ .replace('"', '"') footnote_set = 1 footnotes = [] def execute(hdf, args, env): global footnotes, footnote_set # Display and clear footnotes... if not args: out = StringIO() out.write('