Artifact d81967309e3dd8e55767b48ee87434fcd59fdd18:
- File gluon/contrib/markdown/__init__.py — part of check-in [eba4a35a21] at 2011-08-08 04:53:38 on branch develop — Added web2py 1.98.2 (user: spiffy, size: 535) [annotate] [blame] [check-ins using]
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)