Update Python 3 compatibility

This commit is contained in:
Vinyl Darkscratch
2019-02-09 00:01:11 -08:00
parent fcea326855
commit f434ebec8a
29 changed files with 112 additions and 152 deletions
+2 -1
View File
@@ -1,5 +1,6 @@
from .markdown2 import *
from gluon.html import XML
from gluon._compat import to_unicode
def WIKI(text, encoding="utf8", safe_mode='escape', html4tags=False, **attributes):
if not text:
@@ -9,7 +10,7 @@ def WIKI(text, encoding="utf8", safe_mode='escape', html4tags=False, **attribute
del attributes['extras']
else:
extras=None
text = text.decode(encoding,'replace')
text = to_unicode(text, encoding, 'replace')
return XML(markdown(text,extras=extras,
safe_mode=safe_mode, html4tags=html4tags)\