MobileBlur

__init__.py at [b2d6f6e2e9]
Login

__init__.py at [b2d6f6e2e9]

File gluon/contrib/markdown/__init__.py artifact 87b3777bf4 part of check-in b2d6f6e2e9


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)