From: Benjamin Mako Hill Date: Sun, 10 Apr 2011 19:39:33 +0000 (-0400) Subject: added support for UTF-8 documents X-Git-Url: https://projects.mako.cc/source/pyblosxom-markdown2/commitdiff_plain/af18764fbaee94dbb55a643fc7dbb07bbfd677b0?ds=sidebyside;hp=0940c8368737db9014d3227c34347b9680d8762f added support for UTF-8 documents Fixed issue where the it would return 500 when certain unicode characters were used. --- diff --git a/markdown-plugin.py b/markdown-plugin.py index f60b9a3..1597445 100644 --- a/markdown-plugin.py +++ b/markdown-plugin.py @@ -27,7 +27,7 @@ _version__ = '0.3' __author__ = 'Benjamin Mako Hill ' __author__ = 'seanh ' -FILENAME_EXTENSIONS = ('.txt','.text','.mkdn','.markdown','.md','.mdown','.markdn','.mkd') +FILENAME_EXTENSIONS = ('.mdwn', '.txt','.text','.mkdn','.markdown','.md','.mdown','.markdn','.mkd') import markdown import os @@ -37,6 +37,6 @@ md = markdown.Markdown(output_format='html4',extensions=['extra',]) def cb_story(args): entry = args['entry'] if os.path.splitext(entry['filename'])[1] in FILENAME_EXTENSIONS: - entry['body'] = md.convert(''.join(entry['body'])) + entry['body'] = md.convert(u''.join(entry['body'].decode("utf-8"))) md.reset() - return args \ No newline at end of file + return args