Artifact 87b3777bf465a83c047e4161d1885c7a4c8125c5:
- File gluon/contrib/markdown/__init__.py — part of check-in [5e6e1e2c0a] at 2011-11-20 05:28:20 on branch feature/web2py_auth — Upgraded to web2py 1.99.2 (user: spiffy, size: 536) [annotate] [blame] [check-ins using] [more...]
from markdown2 import * from gluon.html import XML def WIKI(text, encoding="utf8", safe_mode='escape', html4tags=False, **attributes): if not text: test = '' if attributes.has_key('extras'): extras = attributes['extras'] del attributes['extras'] else: extras=None text = text.decode(encoding,'replace') return XML(markdown(text,extras=extras, safe_mode=safe_mode, html4tags=html4tags)\ .encode(encoding,'xmlcharrefreplace'),**attributes)